2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockPlant.java
|
|
|
|
+++ b/net/minecraft/server/BlockPlant.java
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -2,6 +2,10 @@
|
2015-01-31 00:09:45 +01:00
|
|
|
|
|
|
|
import java.util.Random;
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2015-02-26 23:41:06 +01:00
|
|
|
+// CraftBukkit start
|
2015-01-31 00:09:45 +01:00
|
|
|
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
|
|
|
+import org.bukkit.event.block.BlockPhysicsEvent;
|
2015-02-26 23:41:06 +01:00
|
|
|
+// CraftBukkit end
|
2015-01-31 00:09:45 +01:00
|
|
|
|
|
|
|
public class BlockPlant extends Block {
|
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -40,6 +44,15 @@
|
2015-01-31 00:09:45 +01:00
|
|
|
|
|
|
|
protected void e(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
if (!this.f(world, blockposition, iblockdata)) {
|
|
|
|
+ // CraftBukkit Start
|
|
|
|
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
|
|
+ BlockPhysicsEvent event = new BlockPhysicsEvent(block, block.getTypeId());
|
|
|
|
+ world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.b(world, blockposition, iblockdata, 0);
|
|
|
|
world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
|
|
|
|
}
|