diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 7a0bae475..6af2d60a9 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1030,8 +1030,8 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ $hasUpdate = true; } - if($this->isOnFire()){ - $hasUpdate = ($hasUpdate || $this->doOnFireTick($tickDiff)); + if($this->isOnFire() and $this->doOnFireTick($tickDiff)){ + $hasUpdate = true; } if($this->noDamageTicks > 0){ diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index aa182f1fa..1f10662d9 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -654,7 +654,9 @@ abstract class Living extends Entity implements Damageable{ $hasUpdate = parent::entityBaseTick($tickDiff); - $this->doEffectsTick($tickDiff); + if($this->doEffectsTick($tickDiff)){ + $hasUpdate = true; + } if($this->isAlive()){ if($this->isInsideOfSolid()){ @@ -666,6 +668,7 @@ abstract class Living extends Entity implements Damageable{ if(!$this->canBreathe()){ $this->setBreathing(false); $this->doAirSupplyTick($tickDiff); + $hasUpdate = true; }elseif(!$this->isBreathing()){ $this->setBreathing(true); $this->setAirSupplyTicks($this->getMaxAirSupplyTicks()); @@ -681,7 +684,7 @@ abstract class Living extends Entity implements Damageable{ return $hasUpdate; } - protected function doEffectsTick(int $tickDiff = 1) : void{ + protected function doEffectsTick(int $tickDiff = 1) : bool{ foreach($this->effects as $instance){ $type = $instance->getType(); if($type->canTick($instance)){ @@ -692,6 +695,8 @@ abstract class Living extends Entity implements Damageable{ $this->removeEffect($instance->getId()); } } + + return !empty($this->effects); } /**