From 5412d6f5a8d7e63b14a977b15f8da1c823cad351 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 12 Dec 2011 21:23:46 +0000 Subject: [PATCH] Fixed crash with dispensers dispensing dispensables --- src/main/java/net/minecraft/server/ItemStack.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java index b19f5b08be..79e431af69 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -43,11 +43,13 @@ public final class ItemStack { public ItemStack(int id, int count, int data, NBTTagList enchantments) { this(id, count, data); // taken from .addEnchantment - if (this.tag == null) { - this.setTag(new NBTTagCompound()); - } + if (Item.byId[this.id].getMaxStackSize() == 1) { + if (this.tag == null) { + this.setTag(new NBTTagCompound()); + } - this.tag.set("ench", enchantments); // modify this part to use passed in enchantments list + this.tag.set("ench", enchantments.clone()); // modify this part to use passed in enchantments list + } } // CraftBukkit end