Living: don't applyPostDamageEffects() for dead mobs

this has already been seen to cause duplication bugs when thorns is used. Anything else that modifies inventory during applyPostDamageEffects() when the mob is possibly dead will also cause duplication issues.
This commit is contained in:
Dylan K. Taylor 2018-06-22 14:31:48 +01:00
parent 641a5a5e23
commit a5a236084f

View File

@ -469,6 +469,7 @@ abstract class Living extends Entity implements Damageable{
/**
* Called after EntityDamageEvent execution to apply post-hurt effects, such as reducing absorption or modifying
* armour durability.
* This will not be called by damage sources causing death.
*
* @param EntityDamageEvent $source
*/
@ -551,9 +552,9 @@ abstract class Living extends Entity implements Damageable{
}
}
$this->applyPostDamageEffects($source);
if($this->isAlive()){
$this->applyPostDamageEffects($source);
$this->doHitAnimation();
}else{
$this->startDeathAnimation();