mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user