From f9411418790cec1de2fc4c04539c5a80f13ed3e8 Mon Sep 17 00:00:00 2001 From: Dennis Date: Sat, 20 May 2023 22:38:48 +0300 Subject: [PATCH] use short to store index of inventory slot --- src/main/java/mantle/blocks/abstracts/InventoryLogic.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/mantle/blocks/abstracts/InventoryLogic.java b/src/main/java/mantle/blocks/abstracts/InventoryLogic.java index 11aeec1..fc1ea76 100644 --- a/src/main/java/mantle/blocks/abstracts/InventoryLogic.java +++ b/src/main/java/mantle/blocks/abstracts/InventoryLogic.java @@ -114,7 +114,7 @@ public abstract class InventoryLogic extends TileEntity implements IInventory, I for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - int j = nbttagcompound1.getByte("Slot") & 255; + int j = nbttagcompound1.getShort("Slot") & 0xffff; if (j >= 0 && j < this.inventory.length) { this.inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); @@ -150,7 +150,7 @@ public abstract class InventoryLogic extends TileEntity implements IInventory, I for (int i = 0; i < this.inventory.length; ++i) { if (this.inventory[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); + nbttagcompound1.setShort("Slot", (short) i); this.inventory[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); }