mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Refactored entity IDs in packets for consistency and to clarify on types
This commit is contained in:
@ -1195,7 +1195,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->level->sleepTicks = 0;
|
||||
|
||||
$pk = new AnimatePacket();
|
||||
$pk->eid = $this->id;
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
$pk->action = 3; //Wake up
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
@ -1638,7 +1638,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$entries = $sendAll ? $this->attributeMap->getAll() : $this->attributeMap->needSend();
|
||||
if(count($entries) > 0){
|
||||
$pk = new UpdateAttributesPacket();
|
||||
$pk->entityId = $this->id;
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
$pk->entries = $entries;
|
||||
$this->dataPacket($pk);
|
||||
foreach($entries as $entry){
|
||||
@ -2573,7 +2573,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return true;
|
||||
}
|
||||
|
||||
$packet->eid = $this->id;
|
||||
$packet->entityRuntimeId = $this->id;
|
||||
$pos = new Vector3($packet->x, $packet->y, $packet->z);
|
||||
|
||||
switch($packet->action){
|
||||
@ -2684,7 +2684,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->entityRuntimeId = $this->getId();
|
||||
$pk->event = EntityEventPacket::USE_ITEM;
|
||||
$this->dataPacket($pk);
|
||||
$this->server->broadcastPacket($this->getViewers(), $pk);
|
||||
@ -2840,7 +2840,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
$pk = new AnimatePacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->entityRuntimeId = $this->getId();
|
||||
$pk->action = $ev->getAnimationType();
|
||||
$this->server->broadcastPacket($this->getViewers(), $pk);
|
||||
|
||||
@ -3936,7 +3936,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return;
|
||||
}elseif($this->getLastDamageCause() === $source and $this->spawned){
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->id;
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
$pk->event = EntityEventPacket::HURT_ANIMATION;
|
||||
$this->dataPacket($pk);
|
||||
|
||||
@ -3951,7 +3951,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$pitch = $pitch === null ? $this->pitch : $pitch;
|
||||
|
||||
$pk = new MovePlayerPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->entityRuntimeId = $this->getId();
|
||||
$pk->x = $pos->x;
|
||||
$pk->y = $pos->y + $this->getEyeHeight();
|
||||
$pk->z = $pos->z;
|
||||
|
Reference in New Issue
Block a user