mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
EntityDamageEvent and children now only fire if the attack is possible, moved event trigger to Entity->attack()
This commit is contained in:
@ -172,13 +172,8 @@ class Explosion{
|
||||
$ev = EntityDamageEvent::createEvent($entity, EntityDamageEvent::CAUSE_BLOCK_EXPLOSION, $damage);
|
||||
}
|
||||
|
||||
$this->level->getServer()->getPluginManager()->callEvent($ev);
|
||||
|
||||
if(!$ev->isCancelled()){
|
||||
$entity->attack($ev->getFinalDamage(), $ev);
|
||||
$entity->setMotion($motion->multiply($impact));
|
||||
}
|
||||
|
||||
$entity->attack($ev->getFinalDamage(), $ev);
|
||||
$entity->setMotion($motion->multiply($impact));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user