From c3bbb8905c7eae81da24a69d863b030dcba1457e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 28 Jan 2019 17:33:58 +0000 Subject: [PATCH] Human: simplify setFood() --- src/pocketmine/entity/Human.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 266ea5aaa..45573edbd 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -206,18 +206,13 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ $old = $attr->getValue(); $attr->setValue($new); - $reset = false; // ranges: 18-20 (regen), 7-17 (none), 1-6 (no sprint), 0 (health depletion) foreach([17, 6, 0] as $bound){ if(($old > $bound) !== ($new > $bound)){ - $reset = true; + $this->foodTickTimer = 0; break; } } - if($reset){ - $this->foodTickTimer = 0; - } - } public function getMaxFood() : float{