mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Added Player death animations, improved spawning behavior to correct invisible players, fixed players getting stuck when dead, closes #2304
This commit is contained in:
@ -93,10 +93,6 @@ abstract class Living extends Entity implements Damageable{
|
||||
}
|
||||
}
|
||||
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->event = 2; //Ouch!
|
||||
Server::broadcastPacket($this->hasSpawned, $pk);
|
||||
$this->setLastDamageCause($source);
|
||||
|
||||
if($source instanceof EntityDamageByEntityEvent){
|
||||
@ -109,6 +105,11 @@ abstract class Living extends Entity implements Damageable{
|
||||
|
||||
$this->setHealth($this->getHealth() - $damage);
|
||||
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->event = $this->getHealth() <= 0 ? 3 : 2; //Ouch!
|
||||
Server::broadcastPacket($this->hasSpawned, $pk);
|
||||
|
||||
$this->attackTime = 10; //0.5 seconds cooldown
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user