mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 18:31:29 +01:00
27 lines
1.0 KiB
Diff
27 lines
1.0 KiB
Diff
--- /home/matt/mc-dev-private//net/minecraft/server/BlockLeaves.java 2015-02-26 22:40:22.163608144 +0000
|
|
+++ src/main/java/net/minecraft/server/BlockLeaves.java 2015-02-26 22:40:22.167608144 +0000
|
|
@@ -2,6 +2,8 @@
|
|
|
|
import java.util.Random;
|
|
|
|
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
|
+
|
|
public abstract class BlockLeaves extends BlockTransparent {
|
|
|
|
public static final BlockStateBoolean DECAYABLE = BlockStateBoolean.of("decayable");
|
|
@@ -130,6 +132,14 @@
|
|
}
|
|
|
|
private void e(World world, BlockPosition blockposition) {
|
|
+ // CraftBukkit start
|
|
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
|
+ world.getServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ if (event.isCancelled() || world.getType(blockposition).getBlock() != this) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.b(world, blockposition, world.getType(blockposition), 0);
|
|
world.setAir(blockposition);
|
|
}
|