Stop converting ItemStack to nms ItemStack by hand

This should fix many issues with enchantments being lost, as the method used takes care of enchantments.
Additionally, use the new nms ItemStack constructor in places where appropriate.

Fixes (at least part of) BUKKIT-7. Need to identify any further places to fix.
This commit is contained in:
Andrew Ardill
2011-12-13 01:40:35 +11:00
parent d34e289434
commit 82965eb10f
5 changed files with 11 additions and 30 deletions

View File

@@ -211,9 +211,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory {
return;
}
org.bukkit.inventory.ItemStack oldResult = furnaceSmeltEvent.getResult();
ItemStack newResult = new ItemStack(oldResult.getTypeId(), oldResult.getAmount(), oldResult.getDurability());
itemstack = newResult;
itemstack = CraftItemStack.createNMSItemStack(furnaceSmeltEvent.getResult());
if (this.items[2] == null) {
this.items[2] = itemstack.cloneItemStack();