diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch new file mode 100644 index 0000000000..84f1ba0a95 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/LeavesBlock.java.patch @@ -0,0 +1,34 @@ +--- a/net/minecraft/world/level/block/LeavesBlock.java ++++ b/net/minecraft/world/level/block/LeavesBlock.java +@@ -24,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 { + +@@ -58,11 +56,18 @@ + } + + @Override +- @Override +- public void randomTick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) { +- if (this.decaying(blockstate)) { +- dropResources(blockstate, serverlevel, blockpos); +- serverlevel.removeBlock(blockpos, false); ++ public void randomTick(IBlockData 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); + } + + } |