Refactored entity IDs in packets for consistency and to clarify on types

This commit is contained in:
Dylan K. Taylor
2017-06-05 15:41:27 +01:00
parent 51d510aa4f
commit 54453d0b0a
21 changed files with 58 additions and 58 deletions

View File

@ -73,7 +73,7 @@ abstract class Living extends Entity implements Damageable{
$this->attributeMap->getAttribute(Attribute::HEALTH)->setValue($this->getHealth(), true);
if($this->isAlive() and !$wasAlive){
$pk = new EntityEventPacket();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->event = EntityEventPacket::RESPAWN;
$this->server->broadcastPacket($this->hasSpawned, $pk);
}
@ -166,7 +166,7 @@ abstract class Living extends Entity implements Damageable{
}
$pk = new EntityEventPacket();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->event = $this->getHealth() <= 0 ? EntityEventPacket::DEATH_ANIMATION : EntityEventPacket::HURT_ANIMATION; //Ouch!
$this->server->broadcastPacket($this->hasSpawned, $pk);