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.

By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2011-12-13 01:40:35 +11:00
parent 90baaa255d
commit 8b46844bf4

View File

@ -19,7 +19,7 @@ public class CraftItem extends CraftEntity implements Item {
}
public void setItemStack(ItemStack stack) {
item.itemStack = new net.minecraft.server.ItemStack(stack.getTypeId(), stack.getAmount(), stack.getDurability());
item.itemStack = CraftItemStack.createNMSItemStack(stack);
}
public int getPickupDelay() {