mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Living: fix being unable to die in the void
This commit is contained in:
parent
734bc6c4a7
commit
915224c8e5
@ -437,6 +437,9 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
*/
|
*/
|
||||||
public function applyDamageModifiers(EntityDamageEvent $source) : void{
|
public function applyDamageModifiers(EntityDamageEvent $source) : void{
|
||||||
if($this->lastDamageCause !== null and $this->attackTime > 0){
|
if($this->lastDamageCause !== null and $this->attackTime > 0){
|
||||||
|
if($this->lastDamageCause->getBaseDamage() >= $source->getBaseDamage()){
|
||||||
|
$source->setCancelled();
|
||||||
|
}
|
||||||
$source->setModifier(-$this->lastDamageCause->getBaseDamage(), EntityDamageEvent::MODIFIER_PREVIOUS_DAMAGE_COOLDOWN);
|
$source->setModifier(-$this->lastDamageCause->getBaseDamage(), EntityDamageEvent::MODIFIER_PREVIOUS_DAMAGE_COOLDOWN);
|
||||||
}
|
}
|
||||||
if($source->canBeReducedByArmor()){
|
if($source->canBeReducedByArmor()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user