diff --git a/src/pocketmine/network/protocol/AdventureSettingsPacket.php b/src/pocketmine/network/protocol/AdventureSettingsPacket.php index 410966a26..ab4f60312 100644 --- a/src/pocketmine/network/protocol/AdventureSettingsPacket.php +++ b/src/pocketmine/network/protocol/AdventureSettingsPacket.php @@ -32,14 +32,15 @@ class AdventureSettingsPacket extends DataPacket{ public $globalPermission; public function decode(){ - + $this->flags = $this->getUnsignedVarInt(); + $this->userPermission = $this->getUnsignedVarInt(); } public function encode(){ $this->reset(); - $this->putInt($this->flags); - $this->putInt($this->userPermission); - $this->putInt($this->globalPermission); + $this->putUnsignedVarInt($this->flags); + $this->putUnsignedVarInt($this->userPermission); //TODO: verify this + //$this->putInt($this->globalPermission); } } \ No newline at end of file diff --git a/src/pocketmine/network/protocol/ChunkRadiusUpdatedPacket.php b/src/pocketmine/network/protocol/ChunkRadiusUpdatedPacket.php index 78020df2c..87e956543 100644 --- a/src/pocketmine/network/protocol/ChunkRadiusUpdatedPacket.php +++ b/src/pocketmine/network/protocol/ChunkRadiusUpdatedPacket.php @@ -34,7 +34,7 @@ class ChunkRadiusUpdatedPacket extends DataPacket{ public function encode(){ $this->reset(); - $this->putInt($this->radius); + $this->putVarInt($this->radius); } } diff --git a/src/pocketmine/network/protocol/FullChunkDataPacket.php b/src/pocketmine/network/protocol/FullChunkDataPacket.php index 38ad4eb31..b7277e119 100644 --- a/src/pocketmine/network/protocol/FullChunkDataPacket.php +++ b/src/pocketmine/network/protocol/FullChunkDataPacket.php @@ -41,11 +41,10 @@ class FullChunkDataPacket extends DataPacket{ public function encode(){ $this->reset(); - $this->putInt($this->chunkX); - $this->putInt($this->chunkZ); + $this->putVarInt($this->chunkX); + $this->putVarInt($this->chunkZ); $this->putByte($this->order); - $this->putInt(strlen($this->data)); - $this->put($this->data); + $this->putString($this->data); } } diff --git a/src/pocketmine/network/protocol/MovePlayerPacket.php b/src/pocketmine/network/protocol/MovePlayerPacket.php index 74d9c2589..b3dd65496 100644 --- a/src/pocketmine/network/protocol/MovePlayerPacket.php +++ b/src/pocketmine/network/protocol/MovePlayerPacket.php @@ -47,26 +47,22 @@ class MovePlayerPacket extends DataPacket{ } public function decode(){ - $this->eid = $this->getLong(); - $this->x = $this->getFloat(); - $this->y = $this->getFloat(); - $this->z = $this->getFloat(); - $this->yaw = $this->getFloat(); - $this->bodyYaw = $this->getFloat(); - $this->pitch = $this->getFloat(); + $this->eid = $this->getEntityId(); //EntityRuntimeID + $this->getVector3f($this->x, $this->y, $this->z); + $this->pitch = $this->getLFloat(); + $this->yaw = $this->getLFloat(); + $this->bodyYaw = $this->getLFloat(); $this->mode = $this->getByte(); $this->onGround = $this->getByte() > 0; } public function encode(){ $this->reset(); - $this->putLong($this->eid); - $this->putFloat($this->x); - $this->putFloat($this->y); - $this->putFloat($this->z); - $this->putFloat($this->yaw); - $this->putFloat($this->bodyYaw); //TODO - $this->putFloat($this->pitch); + $this->putEntityId($this->eid); //EntityRuntimeID + $this->putVector3f($this->x, $this->y, $this->z); + $this->putLFloat($this->pitch); + $this->putLFloat($this->yaw); + $this->putLFloat($this->bodyYaw); //TODO $this->putByte($this->mode); $this->putByte($this->onGround > 0); } diff --git a/src/pocketmine/network/protocol/RequestChunkRadiusPacket.php b/src/pocketmine/network/protocol/RequestChunkRadiusPacket.php index de526e6e5..5ec1960a7 100644 --- a/src/pocketmine/network/protocol/RequestChunkRadiusPacket.php +++ b/src/pocketmine/network/protocol/RequestChunkRadiusPacket.php @@ -30,7 +30,7 @@ class RequestChunkRadiusPacket extends DataPacket{ public $radius; public function decode(){ - $this->radius = $this->getInt(); + $this->radius = $this->getVarInt(); } public function encode(){