2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockLeaves.java
|
|
|
|
+++ b/net/minecraft/server/BlockLeaves.java
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -2,6 +2,8 @@
|
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
public abstract class BlockLeaves extends Block {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
public static final BlockStateBoolean DECAYABLE = BlockStateBoolean.of("decayable");
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -132,6 +134,14 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
private void b(World world, BlockPosition blockposition) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
|
|
|
+ world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
2014-11-29 23:31:55 +01:00
|
|
|
+ if (event.isCancelled() || world.getType(blockposition).getBlock() != this) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.b(world, blockposition, world.getType(blockposition), 0);
|
|
|
|
world.setAir(blockposition);
|
|
|
|
}
|