Use static constructor for MovePlayerPacket

this marks the last of the packets created using the old way.
This commit is contained in:
Dylan K. Taylor 2021-10-27 21:10:16 +01:00
parent 6d89265510
commit 0ef5c67b9b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 15 additions and 14 deletions

8
composer.lock generated
View File

@ -253,12 +253,12 @@
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "5285dde125b529e070db7eeb0d3774208e1652ef"
"reference": "58c53a259e819a076bf8fe875d2a012da7d19d65"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/5285dde125b529e070db7eeb0d3774208e1652ef",
"reference": "5285dde125b529e070db7eeb0d3774208e1652ef",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/58c53a259e819a076bf8fe875d2a012da7d19d65",
"reference": "58c53a259e819a076bf8fe875d2a012da7d19d65",
"shasum": ""
},
"require": {
@ -293,7 +293,7 @@
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/master"
},
"time": "2021-10-23T15:18:49+00:00"
"time": "2021-10-27T19:49:20+00:00"
},
{
"name": "pocketmine/binaryutils",

View File

@ -727,16 +727,17 @@ class NetworkSession{
$yaw = $yaw ?? $location->getYaw();
$pitch = $pitch ?? $location->getPitch();
$pk = new MovePlayerPacket();
$pk->actorRuntimeId = $this->player->getId();
$pk->position = $this->player->getOffsetPosition($pos);
$pk->pitch = $pitch;
$pk->headYaw = $yaw;
$pk->yaw = $yaw;
$pk->mode = $mode;
$pk->onGround = $this->player->onGround;
$this->sendDataPacket($pk);
$this->sendDataPacket(MovePlayerPacket::simple(
$this->player->getId(),
$this->player->getOffsetPosition($pos),
$pitch,
$yaw,
$yaw, //TODO: head yaw
$mode,
$this->player->onGround,
0, //TODO: riding entity ID
0 //TODO: tick
));
if($this->handler instanceof InGamePacketHandler){
$this->handler->forceMoveSync = true;