mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Refactored entity IDs in packets for consistency and to clarify on types
This commit is contained in:
@ -30,18 +30,18 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class UpdateAttributesPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::UPDATE_ATTRIBUTES_PACKET;
|
||||
|
||||
public $entityId;
|
||||
public $entityRuntimeId;
|
||||
/** @var Attribute[] */
|
||||
public $entries = [];
|
||||
|
||||
public function decode(){
|
||||
$this->entityId = $this->getEntityRuntimeId();
|
||||
$this->entityRuntimeId = $this->getEntityRuntimeId();
|
||||
$this->entries = $this->getAttributeList();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putEntityRuntimeId($this->entityId);
|
||||
$this->putEntityRuntimeId($this->entityRuntimeId);
|
||||
$this->putAttributeList(...$this->entries);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user