From 66fbfdd47b3c7a7951284c05d22d0ed9418e9ca0 Mon Sep 17 00:00:00 2001 From: Irish Date: Sat, 18 Mar 2017 17:58:02 -0400 Subject: [PATCH] Fixed hunger not saving, resolves 1 of #435 (#439) --- src/pocketmine/entity/Human.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 478d99f7b..d9a26d1ee 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -408,6 +408,12 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ public function 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->setTagType(NBT::TAG_Compound); if($this->inventory !== null){