Renamed fields of AddEntityPacket and RemoveEntityPacket

This commit is contained in:
Dylan K. Taylor 2021-06-04 17:18:24 +01:00
parent 12c66d3362
commit b257348a3a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 14 additions and 14 deletions

View File

@ -31,24 +31,24 @@ class AddEntityPacket extends DataPacket/* implements ClientboundPacket*/{
public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET; public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET;
/** @var int */ /** @var int */
private $uvarint1; private $entityNetId;
public static function create(int $uvarint1) : self{ public static function create(int $entityNetId) : self{
$result = new self; $result = new self;
$result->uvarint1 = $uvarint1; $result->entityNetId = $entityNetId;
return $result; return $result;
} }
public function getUvarint1() : int{ public function getEntityNetId() : int{
return $this->uvarint1; return $this->entityNetId;
} }
protected function decodePayload() : void{ protected function decodePayload() : void{
$this->uvarint1 = $this->getUnsignedVarInt(); $this->entityNetId = $this->getUnsignedVarInt();
} }
protected function encodePayload() : void{ protected function encodePayload() : void{
$this->putUnsignedVarInt($this->uvarint1); $this->putUnsignedVarInt($this->entityNetId);
} }
public function handle(NetworkSession $handler) : bool{ public function handle(NetworkSession $handler) : bool{

View File

@ -31,24 +31,24 @@ class RemoveEntityPacket extends DataPacket/* implements ClientboundPacket*/{
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET; public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
/** @var int */ /** @var int */
private $uvarint1; private $entityNetId;
public static function create(int $uvarint1) : self{ public static function create(int $entityNetId) : self{
$result = new self; $result = new self;
$result->uvarint1 = $uvarint1; $result->entityNetId = $entityNetId;
return $result; return $result;
} }
public function getUvarint1() : int{ public function getEntityNetId() : int{
return $this->uvarint1; return $this->entityNetId;
} }
protected function decodePayload() : void{ protected function decodePayload() : void{
$this->uvarint1 = $this->getUnsignedVarInt(); $this->entityNetId = $this->getUnsignedVarInt();
} }
protected function encodePayload() : void{ protected function encodePayload() : void{
$this->putUnsignedVarInt($this->uvarint1); $this->putUnsignedVarInt($this->entityNetId);
} }
public function handle(NetworkSession $handler) : bool{ public function handle(NetworkSession $handler) : bool{