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
2 changed files with 15 additions and 14 deletions

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;