From 217a52eaa86420237f9f0142774a16b0d6cedd48 Mon Sep 17 00:00:00 2001 From: Riley Park Date: Thu, 21 Apr 2016 23:51:55 -0700 Subject: [PATCH] Add ability to configure frosted_ice properties --- .../level/block/FrostedIceBlock.java.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 paper-server/patches/sources/net/minecraft/world/level/block/FrostedIceBlock.java.patch diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/FrostedIceBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/FrostedIceBlock.java.patch new file mode 100644 index 0000000000..9d1efc3454 --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/level/block/FrostedIceBlock.java.patch @@ -0,0 +1,24 @@ +--- a/net/minecraft/world/level/block/FrostedIceBlock.java ++++ b/net/minecraft/world/level/block/FrostedIceBlock.java +@@ -42,6 +42,7 @@ + + @Override + protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { ++ if (!world.paperConfig().environment.frostedIce.enabled) return; // Paper - Frosted ice options + if ((random.nextInt(3) == 0 || this.fewerNeigboursThan(world, pos, 4)) + && world.getMaxLocalRawBrightness(pos) > 11 - state.getValue(AGE) - state.getLightBlock() + && this.slightlyMelt(state, world, pos)) { +@@ -51,11 +52,11 @@ + mutableBlockPos.setWithOffset(pos, direction); + BlockState blockState = world.getBlockState(mutableBlockPos); + if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) { +- world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, 20, 40)); ++ world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - Frosted ice options + } + } + } else { +- world.scheduleTick(pos, this, Mth.nextInt(random, 20, 40)); ++ world.scheduleTick(pos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - Frosted ice options + } + } +