diff --git a/src/pocketmine/network/mcpe/protocol/MoveEntityPacket.php b/src/pocketmine/network/mcpe/protocol/MoveEntityPacket.php index fbda02c9ea..6e62b80410 100644 --- a/src/pocketmine/network/mcpe/protocol/MoveEntityPacket.php +++ b/src/pocketmine/network/mcpe/protocol/MoveEntityPacket.php @@ -36,6 +36,7 @@ class MoveEntityPacket extends DataPacket{ public $yaw; public $headYaw; public $pitch; + public $byte1; public function decode(){ $this->eid = $this->getEntityRuntimeId(); @@ -43,6 +44,7 @@ class MoveEntityPacket extends DataPacket{ $this->pitch = $this->getByte() * (360.0 / 256); $this->yaw = $this->getByte() * (360.0 / 256); $this->headYaw = $this->getByte() * (360.0 / 256); + $this->byte1 = $this->getByte(); } public function encode(){ @@ -52,6 +54,7 @@ class MoveEntityPacket extends DataPacket{ $this->putByte($this->pitch / (360.0 / 256)); $this->putByte($this->yaw / (360.0 / 256)); $this->putByte($this->headYaw / (360.0 / 256)); + $this->putByte($this->byte1); } public function handle(NetworkSession $session) : bool{ diff --git a/src/pocketmine/network/mcpe/protocol/ResourcePackStackPacket.php b/src/pocketmine/network/mcpe/protocol/ResourcePackStackPacket.php index 32633a7fbd..2960623486 100644 --- a/src/pocketmine/network/mcpe/protocol/ResourcePackStackPacket.php +++ b/src/pocketmine/network/mcpe/protocol/ResourcePackStackPacket.php @@ -41,14 +41,14 @@ class ResourcePackStackPacket extends DataPacket{ public function decode(){ /*$this->mustAccept = $this->getBool(); - $behaviorPackCount = $this->getLShort(); + $behaviorPackCount = $this->getUnsignedVarInt(); while($behaviorPackCount-- > 0){ $packId = $this->getString(); $version = $this->getString(); $this->behaviorPackStack[] = new ResourcePackInfoEntry($packId, $version); } - $resourcePackCount = $this->getLShort(); + $resourcePackCount = $this->getUnsignedVarInt(); while($resourcePackCount-- > 0){ $packId = $this->getString(); $version = $this->getString(); @@ -60,13 +60,13 @@ class ResourcePackStackPacket extends DataPacket{ $this->reset(); $this->putBool($this->mustAccept); - $this->putLShort(count($this->behaviorPackStack)); + $this->putUnsignedVarInt(count($this->behaviorPackStack)); foreach($this->behaviorPackStack as $entry){ $this->putString($entry->getPackId()); $this->putString($entry->getPackVersion()); } - $this->putLShort(count($this->resourcePackStack)); + $this->putUnsignedVarInt(count($this->resourcePackStack)); foreach($this->resourcePackStack as $entry){ $this->putString($entry->getPackId()); $this->putString($entry->getPackVersion()); diff --git a/src/pocketmine/network/mcpe/protocol/ResourcePacksInfoPacket.php b/src/pocketmine/network/mcpe/protocol/ResourcePacksInfoPacket.php index 3b07fe3590..8b077933a9 100644 --- a/src/pocketmine/network/mcpe/protocol/ResourcePacksInfoPacket.php +++ b/src/pocketmine/network/mcpe/protocol/ResourcePacksInfoPacket.php @@ -39,19 +39,19 @@ class ResourcePacksInfoPacket extends DataPacket{ public function decode(){ /*$this->mustAccept = $this->getBool(); - $behaviorPackCount = $this->getLShort(); + $behaviorPackCount = $this->getUnsignedVarInt(); while($behaviorPackCount-- > 0){ $id = $this->getString(); $version = $this->getString(); - $size = $this->getLLong(); + $size = $this->getUnsignedVarLong(); $this->behaviorPackEntries[] = new ResourcePackInfoEntry($id, $version, $size); } - $resourcePackCount = $this->getLShort(); + $resourcePackCount = $this->getUnsignedVarInt(); while($resourcePackCount-- > 0){ $id = $this->getString(); $version = $this->getString(); - $size = $this->getLLong(); + $size = $this->getUnsignedVarLong(); $this->resourcePackEntries[] = new ResourcePackInfoEntry($id, $version, $size); }*/ } @@ -60,17 +60,17 @@ class ResourcePacksInfoPacket extends DataPacket{ $this->reset(); $this->putBool($this->mustAccept); - $this->putLShort(count($this->behaviorPackEntries)); + $this->putUnsignedVarInt(count($this->behaviorPackEntries)); foreach($this->behaviorPackEntries as $entry){ $this->putString($entry->getPackId()); $this->putString($entry->getPackVersion()); - $this->putLLong($entry->getPackSize()); + $this->putUnsignedVarLong($entry->getPackSize()); } - $this->putLShort(count($this->resourcePackEntries)); + $this->putUnsignedVarInt(count($this->resourcePackEntries)); foreach($this->resourcePackEntries as $entry){ $this->putString($entry->getPackId()); $this->putString($entry->getPackVersion()); - $this->putLLong($entry->getPackSize()); + $this->putUnsignedVarLong($entry->getPackSize()); } }