/** * Loads the CustomWood entity from a NBTTag, as to load from a savefile. * * @param tag the tag to load the entity data from. */ @Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT(tag); this.setMaterial(tag); }
@Override public void writeToNBT(NBTTagCompound tag) { tag.setString(Names.NBT.material, Block.blockRegistry.getNameForObject(this.getMaterial())); tag.setInteger(Names.NBT.materialMeta, this.getMaterialMeta()); super.writeToNBT(tag); }