@@ -3,15 +3,15 @@
|
||||
@@ -40,7 +40,11 @@
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (this.f == 0 && block instanceof BlockCrops && ((BlockCrops) block).z(iblockdata)) {
|
||||
if (this.i == 0 && block instanceof BlockCrops && ((BlockCrops) block).w(iblockdata)) {
|
||||
- world.setAir(blockposition, true);
|
||||
+ // CraftBukkit start
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.c, blockposition, Blocks.AIR, 0).isCancelled()) {
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
+ world.setAir(blockposition, true);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else if (this.f == 1 && iblockdata.getMaterial() == Material.AIR) {
|
||||
InventorySubcontainer inventorysubcontainer = this.c.dq();
|
||||
} else if (this.i == 1 && iblockdata.isAir()) {
|
||||
InventorySubcontainer inventorysubcontainer = this.f.dD();
|
||||
|
||||
@@ -49,19 +53,28 @@
|
||||
boolean flag = false;
|
||||
@@ -32,12 +32,12 @@
|
||||
+ planted = Blocks.CARROTS;
|
||||
flag = true;
|
||||
} else if (itemstack.getItem() == Items.BEETROOT_SEEDS) {
|
||||
- world.setTypeAndData(blockposition, Blocks.BEETROOT.getBlockData(), 3);
|
||||
+ planted = Blocks.BEETROOT;
|
||||
- world.setTypeAndData(blockposition, Blocks.BEETROOTS.getBlockData(), 3);
|
||||
+ planted = Blocks.BEETROOTS;
|
||||
flag = true;
|
||||
}
|
||||
+
|
||||
+ if (planted != null && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.c, blockposition, planted, 0).isCancelled()) {
|
||||
+ if (planted != null && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, blockposition, planted.getBlockData()).isCancelled()) {
|
||||
+ world.setTypeAndData(blockposition, planted.getBlockData(), 3);
|
||||
+ } else {
|
||||
+ flag = false;
|
||||
|
||||
Reference in New Issue
Block a user