diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2013-12-16 21:02:39 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-12-17 16:49:38 -0600 |
commit | 0e809d83185c75afa3891255b7104a7e0949bc4e (patch) | |
tree | d4e813ef5525985dbe84d99b57ee5a6dd3744f4b | |
parent | 9a6d035998b7bcc2da98e4507e1afa265d920c46 (diff) | |
download | craftbukkit-0e809d83185c75afa3891255b7104a7e0949bc4e.tar craftbukkit-0e809d83185c75afa3891255b7104a7e0949bc4e.tar.gz craftbukkit-0e809d83185c75afa3891255b7104a7e0949bc4e.tar.lz craftbukkit-0e809d83185c75afa3891255b7104a7e0949bc4e.tar.xz craftbukkit-0e809d83185c75afa3891255b7104a7e0949bc4e.zip |
[Bleeding] Fix incorrect Cocoa Bean orientation. Addresses BUKKIT-5182
When ItemDye is used to place a Cocoa Block, the postPlace() method
should not be called, as data is handled within the ItemDye class.
However, if Cocoa is placed via its block item, postPlace() should
still be called to mirror vanilla behavior.
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBlock.java | 5 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/ItemDye.java | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index 0449461d..3cb4f839 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -103,6 +103,11 @@ public class ItemBlock extends Item { world.update(x, y, z, block); + // Cocoa beans placed via ItemDye do not need the rest of the processing + if (block == Blocks.COCOA && itemstack != null && itemstack.getItem() instanceof ItemDye) { + return true; + } + // Skulls don't get block data applied to them if (block != null && block != Blocks.SKULL) { block.postPlace(world, x, y, z, entityhuman, itemstack); diff --git a/src/main/java/net/minecraft/server/ItemDye.java b/src/main/java/net/minecraft/server/ItemDye.java index da6a75d8..e5d210f4 100644 --- a/src/main/java/net/minecraft/server/ItemDye.java +++ b/src/main/java/net/minecraft/server/ItemDye.java @@ -70,7 +70,7 @@ public class ItemDye extends Item { // 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)) { + if (!ItemBlock.processBlockPlace(world, entityhuman, itemstack, i, j, k, Blocks.COCOA, j1, clickedX, clickedY, clickedZ)) { return false; } // CraftBukkit end |