@Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT(tag); tank.readFromNBT(tag.getCompoundTag("tank")); stack = new ItemStack[this.getSizeInventory()]; NBTTagList list = tag.getTagList("inventory", 10); for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound nbttagcompound = list.getCompoundTagAt(i); int j = nbttagcompound.getByte("Slot") & 255; if (j >= 0 && j < this.stack.length) { this.stack[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); } } this.progress = tag.getInteger("progress"); }