From 59aaa6a80a5a6fddb38d79eb9e8130851a64646c Mon Sep 17 00:00:00 2001 From: feildmaster Date: Mon, 6 Aug 2012 08:49:27 -0500 Subject: [PATCH] Fix dispenser removing data from items. Fixes BUKKIT-2045 --- src/main/java/net/minecraft/server/BlockDispenser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java index 1114f69409..bb1928a25a 100644 --- a/src/main/java/net/minecraft/server/BlockDispenser.java +++ b/src/main/java/net/minecraft/server/BlockDispenser.java @@ -106,8 +106,9 @@ public class BlockDispenser extends BlockContainer { ItemStack itemstack = tileentitydispenser.getItem(i1); // CraftBukkit start - // Copy item stack, because we want it to have 1 item - itemstack = new ItemStack(itemstack.id, 1, itemstack.getData(), itemstack.getEnchantments()); + // Clone item stack, then set the count to 1 + itemstack = itemstack.cloneItemStack(); + itemstack.count = 1; double d3 = random.nextDouble() * 0.1D + 0.2D; double motX = (double) b0 * d3;