Living: fixed death animation not being played when kill() is used

this fixes players having a random delayed despawn when using /kill on themselves
This commit is contained in:
Dylan K. Taylor 2018-06-29 16:49:40 +01:00
parent 905259a4e1
commit a57ec1b1ba

View File

@ -557,8 +557,6 @@ abstract class Living extends Entity implements Damageable{
if($this->isAlive()){
$this->applyPostDamageEffects($source);
$this->doHitAnimation();
}else{
$this->startDeathAnimation();
}
}
@ -597,6 +595,7 @@ abstract class Living extends Entity implements Damageable{
public function kill() : void{
parent::kill();
$this->onDeath();
$this->startDeathAnimation();
}
protected function onDeath() : void{