diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index a033f1e5d9..41fde2edba 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -68,8 +68,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } public void setItemOnCursor(ItemStack item) { - CraftItemStack stack = new CraftItemStack(item.getType(), item.getAmount(), item.getDurability()); - getHandle().inventory.setCarried(stack.getType() == Material.AIR ? null : stack.getHandle()); + CraftItemStack stack = new CraftItemStack(item); + getHandle().inventory.setCarried(stack.getHandle()); if (this instanceof CraftPlayer) { ((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 79731c50ae..d64df14338 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -266,7 +266,7 @@ public class CraftInventory implements Inventory { } else { // More than a single stack! if (item.getAmount() > getMaxItemStack()) { - CraftItemStack stack = new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDurability()); + CraftItemStack stack = new CraftItemStack(item); stack.addUnsafeEnchantments(item.getEnchantments()); setItem(firstFree, stack); item.setAmount(item.getAmount() - getMaxItemStack()); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java index cdb56ffc83..6e20363cc0 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java @@ -114,7 +114,7 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn if (item == null || item.getTypeId() <= 0) { mcItems[i] = null; } else { - mcItems[i] = new net.minecraft.server.ItemStack( item.getTypeId(), item.getAmount(), item.getDurability()); + mcItems[i] = CraftItemStack.createNMSItemStack(item); } } else { mcItems[i] = null;