mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 19:55:33 +00:00
Merge branch 'release/3.2'
This commit is contained in:
commit
286e062086
@ -1010,8 +1010,8 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
$hasUpdate = true;
|
$hasUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->isOnFire()){
|
if($this->isOnFire() and $this->doOnFireTick($tickDiff)){
|
||||||
$hasUpdate = ($hasUpdate || $this->doOnFireTick($tickDiff));
|
$hasUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->noDamageTicks > 0){
|
if($this->noDamageTicks > 0){
|
||||||
|
@ -650,7 +650,9 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
|
|
||||||
$hasUpdate = parent::entityBaseTick($tickDiff);
|
$hasUpdate = parent::entityBaseTick($tickDiff);
|
||||||
|
|
||||||
$this->doEffectsTick($tickDiff);
|
if($this->doEffectsTick($tickDiff)){
|
||||||
|
$hasUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->isAlive()){
|
if($this->isAlive()){
|
||||||
if($this->isInsideOfSolid()){
|
if($this->isInsideOfSolid()){
|
||||||
@ -662,6 +664,7 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
if(!$this->canBreathe()){
|
if(!$this->canBreathe()){
|
||||||
$this->setBreathing(false);
|
$this->setBreathing(false);
|
||||||
$this->doAirSupplyTick($tickDiff);
|
$this->doAirSupplyTick($tickDiff);
|
||||||
|
$hasUpdate = true;
|
||||||
}elseif(!$this->isBreathing()){
|
}elseif(!$this->isBreathing()){
|
||||||
$this->setBreathing(true);
|
$this->setBreathing(true);
|
||||||
$this->setAirSupplyTicks($this->getMaxAirSupplyTicks());
|
$this->setAirSupplyTicks($this->getMaxAirSupplyTicks());
|
||||||
@ -677,7 +680,7 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
return $hasUpdate;
|
return $hasUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function doEffectsTick(int $tickDiff = 1) : void{
|
protected function doEffectsTick(int $tickDiff = 1) : bool{
|
||||||
foreach($this->effects as $instance){
|
foreach($this->effects as $instance){
|
||||||
$type = $instance->getType();
|
$type = $instance->getType();
|
||||||
if($type->canTick($instance)){
|
if($type->canTick($instance)){
|
||||||
@ -688,6 +691,8 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
$this->removeEffect($instance->getId());
|
$this->removeEffect($instance->getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return !empty($this->effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user