Cleaned up EntityEventPacket handling

This commit is contained in:
Dylan K. Taylor
2017-11-04 18:31:35 +00:00
parent ddb7fd12f2
commit a66a757f56
4 changed files with 14 additions and 16 deletions

View File

@@ -3635,10 +3635,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
if($source->isCancelled()){
return;
}elseif($this->getLastDamageCause() === $source and $this->spawned){
$pk = new EntityEventPacket();
$pk->entityRuntimeId = $this->id;
$pk->event = EntityEventPacket::HURT_ANIMATION;
$this->dataPacket($pk);
$this->broadcastEntityEvent(EntityEventPacket::HURT_ANIMATION);
if($this->isSurvival()){
$this->exhaust(0.3, PlayerExhaustEvent::CAUSE_DAMAGE);