mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Use static constructor for MovePlayerPacket
this marks the last of the packets created using the old way.
This commit is contained in:
parent
6d89265510
commit
0ef5c67b9b
8
composer.lock
generated
8
composer.lock
generated
@ -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",
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user