/// <summary> /// Reads food stats from an NBT object. /// </summary> public virtual void ReadNBT(NBTTagCompound par1NBTTagCompound) { if (par1NBTTagCompound.HasKey("foodLevel")) { FoodLevel = par1NBTTagCompound.GetInteger("foodLevel"); FoodTimer = par1NBTTagCompound.GetInteger("foodTickTimer"); FoodSaturationLevel = par1NBTTagCompound.GetFloat("foodSaturationLevel"); FoodExhaustionLevel = par1NBTTagCompound.GetFloat("foodExhaustionLevel"); } }
/// <summary> /// Reads a tile entity from NBT. /// </summary> public override void ReadFromNBT(NBTTagCompound par1NBTTagCompound) { base.ReadFromNBT(par1NBTTagCompound); StoredBlockID = par1NBTTagCompound.GetInteger("blockId"); StoredMetadata = par1NBTTagCompound.GetInteger("blockData"); StoredOrientation = par1NBTTagCompound.GetInteger("facing"); LastProgress = Progress = par1NBTTagCompound.GetFloat("progress"); Extending = par1NBTTagCompound.Getbool("extending"); }