Fixed hunger not saving, resolves 1 of #435 (#439)

This commit is contained in:
Irish 2017-03-18 17:58:02 -04:00 committed by Dylan K. Taylor
parent 116cba9fae
commit 66fbfdd47b

View File

@ -408,6 +408,12 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
public function saveNBT(){ public function saveNBT(){
parent::saveNBT(); parent::saveNBT();
$this->namedtag->foodLevel = new IntTag("foodLevel", $this->getFood());
$this->namedtag->foodExhaustionLevel = new FloatTag("foodExhaustionLevel", $this->getExhaustion());
$this->namedtag->foodSaturationLevel = new FloatTag("foodSaturationLevel", $this->getSaturation());
$this->namedtag->foodTickTimer = new IntTag("foodTickTimer", $this->foodTickTimer);
$this->namedtag->Inventory = new ListTag("Inventory", []); $this->namedtag->Inventory = new ListTag("Inventory", []);
$this->namedtag->Inventory->setTagType(NBT::TAG_Compound); $this->namedtag->Inventory->setTagType(NBT::TAG_Compound);
if($this->inventory !== null){ if($this->inventory !== null){