diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch new file mode 100644 index 0000000000..993ad9adb7 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch @@ -0,0 +1,25 @@ +--- a/net/minecraft/world/level/block/LeavesBlock.java ++++ b/net/minecraft/world/level/block/LeavesBlock.java +@@ -23,6 +24,7 @@ + import net.minecraft.world.level.material.Fluids; + import net.minecraft.world.phys.shapes.Shapes; + import net.minecraft.world.phys.shapes.VoxelShape; ++import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit + + public class LeavesBlock extends Block implements SimpleWaterloggedBlock { + public static final MapCodec<LeavesBlock> CODEC = simpleCodec(LeavesBlock::new); +@@ -61,6 +58,14 @@ + @Override + public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (this.decaying(state)) { ++ // CraftBukkit start ++ LeavesDecayEvent event = new LeavesDecayEvent(level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ())); ++ level.getCraftServer().getPluginManager().callEvent(event); ++ ++ if (event.isCancelled() || level.getBlockState(pos).getBlock() != this) { ++ return; ++ } ++ // CraftBukkit end + dropResources(state, level, pos); + level.removeBlock(pos, false); + } |