@Override public void readCommonNBT(NBTTagCompound nbt) { super.readCommonNBT(nbt); if (nbt.hasKey("isRedstonePowerd")) isRedstonePowered = nbt.getBoolean("isRedstonePowerd"); if (nbt.hasKey("burning")) burning = nbt.getInteger("burning"); if (nbt.hasKey("burningItem")) { NBTTagCompound tag = (NBTTagCompound) nbt.getTag("burningItem"); burningItem = ItemStack.loadItemStackFromNBT(tag); } }
@Override public void writeCommonNBT(NBTTagCompound nbt) { super.writeCommonNBT(nbt); nbt.setBoolean("isRedstonePowerd", isRedstonePowered); nbt.setInteger("burning", burning); NBTTagCompound tag = new NBTTagCompound(); if (burningItem != null) { burningItem.writeToNBT(tag); } nbt.setTag("burningItem", tag); }