From 1f73c08762d0882f3d153fc2ac096b31437a2126 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 19 May 2018 16:47:04 +0100 Subject: [PATCH] Human: fix possible bug with food ticking it updates it but doesn't take note of the updated value, which could cause the code below to be erroneously triggered. --- src/pocketmine/entity/Human.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 572a15642b..3a06acd92c 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -643,6 +643,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ if($difficulty === Level::DIFFICULTY_PEACEFUL and $this->foodTickTimer % 10 === 0){ if($food < 20){ $this->addFood(1.0); + $food = $this->getFood(); } if($this->foodTickTimer % 20 === 0 and $health < $this->getMaxHealth()){ $this->heal(new EntityRegainHealthEvent($this, 1, EntityRegainHealthEvent::CAUSE_SATURATION));