@Override public void readSyncData(NBTTagCompound tag) { super.readSyncData(tag); this.RCStorage = tag.getDouble("RCStorage"); this.batterySlots = new ItemStack[this.batterySlots.length]; NBTTagList nbttaglist = tag.getTagList("RCSlots", 10); for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); byte b0 = nbttagcompound1.getByte("Slot"); if (b0 >= 0 && b0 < this.batterySlots.length) { this.batterySlots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } }