for(int i = 0; i < inventory.length; i++) {
if(inventory[i] != null) {
NBTTagCompound slotEntry = new NBTTagCompound();
slotEntry.setByte(Constants.NBT.SLOT, (byte) i);
inventory[i].writeToNBT(slotEntry);
inventoryList.appendTag(slotEntry);
}
}
backpackSave.setInventory(inventoryName, inventoryList);
}