protocol: rename some useless fields

This commit is contained in:
Dylan K. Taylor 2020-04-17 01:58:06 +01:00
parent 2e720b48d9
commit f428a9bf52
2 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ class UpdateEquipPacket extends DataPacket{
/** @var int */
public $windowType;
/** @var int */
public $unknownVarint; //TODO: find out what this is (vanilla always sends 0)
public $windowSlotCount; //useless, seems to be part of a standard container header
/** @var int */
public $entityUniqueId;
/** @var string */
@ -44,7 +44,7 @@ class UpdateEquipPacket extends DataPacket{
protected function decodePayload(){
$this->windowId = $this->getByte();
$this->windowType = $this->getByte();
$this->unknownVarint = $this->getVarInt();
$this->windowSlotCount = $this->getVarInt();
$this->entityUniqueId = $this->getEntityUniqueId();
$this->namedtag = $this->getRemaining();
}
@ -52,7 +52,7 @@ class UpdateEquipPacket extends DataPacket{
protected function encodePayload(){
$this->putByte($this->windowId);
$this->putByte($this->windowType);
$this->putVarInt($this->unknownVarint);
$this->putVarInt($this->windowSlotCount);
$this->putEntityUniqueId($this->entityUniqueId);
$this->put($this->namedtag);
}

View File

@ -38,7 +38,7 @@ class UpdateTradePacket extends DataPacket{
/** @var int */
public $windowType = WindowTypes::TRADING; //Mojang hardcoded this -_-
/** @var int */
public $thisIsAlwaysZero = 0; //hardcoded to 0
public $windowSlotCount = 0; //useless, seems to be part of a standard container header
/** @var int */
public $tradeTier;
/** @var int */
@ -57,7 +57,7 @@ class UpdateTradePacket extends DataPacket{
protected function decodePayload(){
$this->windowId = $this->getByte();
$this->windowType = $this->getByte();
$this->thisIsAlwaysZero = $this->getVarInt();
$this->windowSlotCount = $this->getVarInt();
$this->tradeTier = $this->getVarInt();
$this->traderEid = $this->getEntityUniqueId();
$this->playerEid = $this->getEntityUniqueId();
@ -70,7 +70,7 @@ class UpdateTradePacket extends DataPacket{
protected function encodePayload(){
$this->putByte($this->windowId);
$this->putByte($this->windowType);
$this->putVarInt($this->thisIsAlwaysZero);
$this->putVarInt($this->windowSlotCount);
$this->putVarInt($this->tradeTier);
$this->putEntityUniqueId($this->traderEid);
$this->putEntityUniqueId($this->playerEid);