mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
Player: fixed arm swing animation not showing during attack cooldown of victim
closes #4650
This commit is contained in:
parent
4ad8cb02a5
commit
45c4a9673d
@ -1667,13 +1667,13 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$entity->attack($ev);
|
$entity->attack($ev);
|
||||||
|
$this->broadcastAnimation(new ArmSwingAnimation($this), $this->getViewers());
|
||||||
|
|
||||||
$soundPos = $entity->getPosition()->add(0, $entity->size->getHeight() / 2, 0);
|
$soundPos = $entity->getPosition()->add(0, $entity->size->getHeight() / 2, 0);
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
$this->getWorld()->addSound($soundPos, new EntityAttackNoDamageSound());
|
$this->getWorld()->addSound($soundPos, new EntityAttackNoDamageSound());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->broadcastAnimation(new ArmSwingAnimation($this), $this->getViewers());
|
|
||||||
$this->getWorld()->addSound($soundPos, new EntityAttackSound());
|
$this->getWorld()->addSound($soundPos, new EntityAttackSound());
|
||||||
|
|
||||||
if($ev->getModifier(EntityDamageEvent::MODIFIER_CRITICAL) > 0 and $entity instanceof Living){
|
if($ev->getModifier(EntityDamageEvent::MODIFIER_CRITICAL) > 0 and $entity instanceof Living){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user