mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge commit '5dadf1237'
# Conflicts: # resources/vanilla
This commit is contained in:
@ -43,6 +43,7 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
public const MODIFIER_CRITICAL = 7;
|
||||
public const MODIFIER_TOTEM = 8;
|
||||
public const MODIFIER_WEAPON_ENCHANTMENTS = 9;
|
||||
public const MODIFIER_PREVIOUS_DAMAGE_COOLDOWN = 10;
|
||||
|
||||
public const CAUSE_CONTACT = 0;
|
||||
public const CAUSE_ENTITY_ATTACK = 1;
|
||||
@ -184,4 +185,8 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
public function setAttackCooldown(int $attackCooldown) : void{
|
||||
$this->attackCooldown = $attackCooldown;
|
||||
}
|
||||
|
||||
public function isCancelled() : bool{
|
||||
return parent::isCancelled() or $this->getFinalDamage() <= 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user