diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch new file mode 100644 index 0000000000..bab2dbe00e --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java.patch @@ -0,0 +1,28 @@ +--- a/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java ++++ b/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java +@@ -42,15 +44,21 @@ + @Override + public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (!canBeGrass(state, level, pos)) { ++ // CraftBukkit start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(level, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) { ++ return; ++ } ++ // CraftBukkit end + level.setBlockAndUpdate(pos, Blocks.DIRT.defaultBlockState()); + } else { + if (level.getMaxLocalRawBrightness(pos.above()) >= 9) { + BlockState blockState = this.defaultBlockState(); + +- for (int i = 0; i < 4; i++) { +- BlockPos blockPos = pos.offset(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); +- if (level.getBlockState(blockPos).is(Blocks.DIRT) && canPropagate(blockState, level, blockPos)) { +- level.setBlockAndUpdate(blockPos, blockState.setValue(SNOWY, Boolean.valueOf(level.getBlockState(blockPos.above()).is(Blocks.SNOW)))); ++ for (int i = 0; i < 4; ++i) { ++ BlockPos blockposition1 = pos.offset(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); ++ ++ if (level.getBlockState(blockposition1).is(Blocks.DIRT) && canPropagate(iblockdata1, level, blockposition1)) { ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockposition1, (IBlockData) iblockdata1.setValue(SpreadingSnowyDirtBlock.SNOWY, level.getBlockState(blockposition1.above()).is(Blocks.SNOW))); // CraftBukkit + } + } + } |