Пример #1
0
 @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);
   }
 }
Пример #2
0
 @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);
 }