diff options
author | BlackHole <black-hole@live.com> | 2013-12-06 19:06:17 +0100 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-12-08 21:47:26 -0600 |
commit | c7b4514ad30f3b65500152d18355eec59c5f8909 (patch) | |
tree | 96fb4bf9c94b839495cdaffd43ffe2f8d33fd386 /src/main/java/net/minecraft/server/ItemDye.java | |
parent | 36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2 (diff) | |
download | craftbukkit-c7b4514ad30f3b65500152d18355eec59c5f8909.tar craftbukkit-c7b4514ad30f3b65500152d18355eec59c5f8909.tar.gz craftbukkit-c7b4514ad30f3b65500152d18355eec59c5f8909.tar.lz craftbukkit-c7b4514ad30f3b65500152d18355eec59c5f8909.tar.xz craftbukkit-c7b4514ad30f3b65500152d18355eec59c5f8909.zip |
Call BlockPlaceEvent for cocoa beans planted on log. Adds BUKKIT-5039
The behavior of cocoa are now aligned to be the same as other plants.
Pulled from PR #1281
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemDye.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemDye.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/ItemDye.java b/src/main/java/net/minecraft/server/ItemDye.java index 9dde66f7..da6a75d8 100644 --- a/src/main/java/net/minecraft/server/ItemDye.java +++ b/src/main/java/net/minecraft/server/ItemDye.java @@ -24,6 +24,7 @@ public class ItemDye extends Item { } public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) { + final int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit if (!entityhuman.a(i, j, k, l, itemstack)) { return false; } else { @@ -67,7 +68,12 @@ public class ItemDye extends Item { if (world.isEmpty(i, j, k)) { int j1 = Blocks.COCOA.getPlacedData(world, i, j, k, l, f, f1, f2, 0); - world.setTypeAndData(i, j, k, Blocks.COCOA, j1, 2); + // CraftBukkit start + // world.setTypeAndData(i, j, k, Blocks.COCOA, j1, 2); + if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, Blocks.COCOA, j1, clickedX, clickedY, clickedZ)) { + return false; + } + // CraftBukkit end if (!entityhuman.abilities.canInstantlyBuild) { --itemstack.count; } |