@Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); NBTTagList tagList = new NBTTagList(); for (int slot = 0; slot < this.inventory.length; ++slot) { if (this.inventory[slot] != null) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setByte("Slot", (byte) slot); this.inventory[slot].writeToNBT(nbt); tagList.appendTag(nbt); } } tagCompound.setTag("Items", tagList); tagCompound.setBoolean("Freezing", freezing); tagCompound.setInteger("Progress", progress); tagCompound.setInteger("FuelTime", fuelTime); tagCompound.setInteger("Remaining", timeRemaining); }
@Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setShort("CrystalizeTime", (short) timeCanCrystalize); compound.setShort("SubmergeTime", (short) ticksCrystalizingItemSoFar); compound.setShort("SubmergeTimeTotal", (short) ticksPerItem); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < crystalizerItemStackArray.length; ++i) { if (crystalizerItemStackArray[i] != null) { NBTTagCompound nbtTagCompound = new NBTTagCompound(); nbtTagCompound.setByte("Slot", (byte) i); crystalizerItemStackArray[i].writeToNBT(nbtTagCompound); nbttaglist.appendTag(nbtTagCompound); } } compound.setTag("Items", nbttaglist); if (hasCustomName()) { compound.setString("CustomName", crystalizerCustomName); } }