2015-05-25 18:37:24 +08:00
|
|
|
--- a/net/minecraft/server/BlockLeaves.java
|
|
|
|
+++ b/net/minecraft/server/BlockLeaves.java
|
2016-05-10 19:47:39 +08:00
|
|
|
@@ -3,6 +3,8 @@
|
2014-11-26 05:32:16 +08:00
|
|
|
import java.util.Random;
|
2016-05-10 19:47:39 +08:00
|
|
|
import javax.annotation.Nullable;
|
2014-11-26 05:32:16 +08:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
|
|
|
+
|
2016-03-01 05:32:46 +08:00
|
|
|
public abstract class BlockLeaves extends Block {
|
2014-11-26 05:32:16 +08:00
|
|
|
|
|
|
|
public static final BlockStateBoolean DECAYABLE = BlockStateBoolean.of("decayable");
|
2016-05-10 19:47:39 +08:00
|
|
|
@@ -133,6 +135,14 @@
|
2014-11-26 05:32:16 +08:00
|
|
|
}
|
|
|
|
|
2016-03-01 05:32:46 +08:00
|
|
|
private void b(World world, BlockPosition blockposition) {
|
2014-11-26 05:32:16 +08:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
|
|
|
+ world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
2014-11-30 06:31:55 +08:00
|
|
|
+ if (event.isCancelled() || world.getType(blockposition).getBlock() != this) {
|
2014-11-26 05:32:16 +08:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.b(world, blockposition, world.getType(blockposition), 0);
|
|
|
|
world.setAir(blockposition);
|
|
|
|
}
|