mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
EntityDamageEvent and children now only fire if the attack is possible, moved event trigger to Entity->attack()
This commit is contained in:
@ -136,12 +136,8 @@ abstract class Projectile extends Entity{
|
||||
|
||||
|
||||
$ev = EntityDamageByEntityEvent::createEvent($this->shootingEntity === null ? $this : $this->shootingEntity, $movingObjectPosition->entityHit, EntityDamageEvent::CAUSE_PROJECTILE, $damage);
|
||||
$movingObjectPosition->entityHit->attack($ev->getFinalDamage(), $ev);
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev);
|
||||
|
||||
if(!$ev->isCancelled()){
|
||||
$movingObjectPosition->entityHit->attack($ev->getFinalDamage(), $ev);
|
||||
}
|
||||
|
||||
if($this->fireTicks > 0){
|
||||
$ev = EntityCombustByEntityEvent::createEvent($this, $movingObjectPosition->entityHit, 5);
|
||||
|
Reference in New Issue
Block a user