/* Save/Load */ public void saveToNBT(NBTTagCompound tagCompound) { NBTTagList tagList = new NBTTagList(); NBTTagCompound invSlot; for (int i = 0; i < this.inventory.length; ++i) { if (this.inventory[i] != null) { invSlot = new NBTTagCompound(); invSlot.setByte("Slot", (byte) i); this.inventory[i].writeToNBT(invSlot); tagList.appendTag(invSlot); } } tagCompound.setTag("Inventory", tagList); }