diff options
author | James Clarke <jamesrtclarke@me.com> | 2012-11-08 00:26:35 +0000 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-11-17 15:06:18 -0600 |
commit | a575e6b075ec9e63e942111657d6869e00ad42b5 (patch) | |
tree | c49d5e51e40de83fa9d547b8d67af7f67e8f373c /src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java | |
parent | 293474d99b4802bd38e6794b484d91212e8893c8 (diff) | |
download | craftbukkit-a575e6b075ec9e63e942111657d6869e00ad42b5.tar craftbukkit-a575e6b075ec9e63e942111657d6869e00ad42b5.tar.gz craftbukkit-a575e6b075ec9e63e942111657d6869e00ad42b5.tar.lz craftbukkit-a575e6b075ec9e63e942111657d6869e00ad42b5.tar.xz craftbukkit-a575e6b075ec9e63e942111657d6869e00ad42b5.zip |
Use correct itemstack for dispenser behavior chaining. Fixes BUKKIT-2886
When an event changes the item to be dispensed we check to see if the new
item has special behavior for dispensing and if so pass it on to that
behavior handler. However, we are actually checking the old itemstack and
passing the new itemstack so this check fails.
Diffstat (limited to 'src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java')
-rw-r--r-- | src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java index 4895b81c..25e21d25 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java @@ -38,9 +38,10 @@ public class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { itemstack.count++; // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } |