From 8e909f05ca61e9e4c0336dba4765b3c281124350 Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Wed, 9 Mar 2016 18:29:36 +0800 Subject: [PATCH] Fixed setSaturation() working incorrectly --- src/pocketmine/entity/Human.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 7c7b1ab64..659fb6216 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -124,6 +124,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ if(isset($reset)){ $this->foodTickTimer = 0; } + } public function getMaxFood() : float{ @@ -138,7 +139,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ } public function getSaturation() : float{ - return $this->attributeMap->getAttribute(Attribute::HUNGER)->getValue(); + return $this->attributeMap->getAttribute(Attribute::SATURATION)->getValue(); } /** @@ -150,7 +151,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ * @throws \InvalidArgumentException */ public function setSaturation(float $saturation){ - $this->attributeMap->getAttribute(Attribute::HUNGER)->setValue($saturation); + $this->attributeMap->getAttribute(Attribute::SATURATION)->setValue($saturation); } public function addSaturation(float $amount){