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": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git", "url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "5285dde125b529e070db7eeb0d3774208e1652ef" "reference": "58c53a259e819a076bf8fe875d2a012da7d19d65"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/5285dde125b529e070db7eeb0d3774208e1652ef", "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/58c53a259e819a076bf8fe875d2a012da7d19d65",
"reference": "5285dde125b529e070db7eeb0d3774208e1652ef", "reference": "58c53a259e819a076bf8fe875d2a012da7d19d65",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -293,7 +293,7 @@
"issues": "https://github.com/pmmp/BedrockProtocol/issues", "issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/master" "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", "name": "pocketmine/binaryutils",

View File

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