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

@ -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);
}