diff options
author | Alex Ciuba <alexciuba@gmail.com> | 2013-06-10 16:04:38 -0400 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-12-08 23:21:11 -0600 |
commit | 80935e5c2bef9793388bf0e877d66ffc98c60d05 (patch) | |
tree | 8f977140bd5da7e4058cabf9c56f5231c4f53064 /src/main/java/net/minecraft/server | |
parent | 0aa187f151ad829adc0ec20b8bd662d625d561e7 (diff) | |
download | craftbukkit-80935e5c2bef9793388bf0e877d66ffc98c60d05.tar craftbukkit-80935e5c2bef9793388bf0e877d66ffc98c60d05.tar.gz craftbukkit-80935e5c2bef9793388bf0e877d66ffc98c60d05.tar.lz craftbukkit-80935e5c2bef9793388bf0e877d66ffc98c60d05.tar.xz craftbukkit-80935e5c2bef9793388bf0e877d66ffc98c60d05.zip |
Don't consume bonemeal if there is no crop present. Fixes BUKKIT-3790
Bonemeal dispense behavior already took care of decrementing the item
stack, therefore we shouldn't manage the size manually.
Pulled from PR #1172
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java b/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java index 713bbe80..92b3789f 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorBonemeal.java @@ -20,9 +20,8 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem { int k = isourceblock.getBlockZ() + enumfacing.e(); // CraftBukkit start - ItemStack itemstack1 = itemstack.a(1); org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockX(), isourceblock.getBlockY(), isourceblock.getBlockZ()); - CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); + CraftItemStack craftItem = CraftItemStack.asNewCraftStack(itemstack.getItem()); BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!BlockDispenser.eventFired) { @@ -30,12 +29,10 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem { } if (event.isCancelled()) { - itemstack.count++; return itemstack; } if (!event.getItem().equals(craftItem)) { - itemstack.count++; // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); @@ -46,7 +43,7 @@ final class DispenseBehaviorBonemeal extends DispenseBehaviorItem { } // CraftBukkit end - if (ItemDye.a(itemstack1, world, i, j, k)) { // CraftBukkit - itemstack -> itemstack1 + if (ItemDye.a(itemstack, world, i, j, k)) { if (!world.isStatic) { world.triggerEffect(2005, i, j, k, 0); } |