From d8ee657d2037825baa28f67a9a1143be87712e0a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 6 Oct 2020 18:34:38 +0100 Subject: [PATCH] MoveActorAbsolutePacket: added ::create() method --- src/network/mcpe/protocol/MoveActorAbsolutePacket.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/network/mcpe/protocol/MoveActorAbsolutePacket.php b/src/network/mcpe/protocol/MoveActorAbsolutePacket.php index 2844b3a5b..a987cc51f 100644 --- a/src/network/mcpe/protocol/MoveActorAbsolutePacket.php +++ b/src/network/mcpe/protocol/MoveActorAbsolutePacket.php @@ -48,6 +48,17 @@ class MoveActorAbsolutePacket extends DataPacket implements ClientboundPacket, S /** @var float */ public $zRot; + public static function create(int $entityRuntimeId, Vector3 $pos, float $xRot, float $yRot, float $zRot, int $flags = 0) : self{ + $result = new self; + $result->entityRuntimeId = $entityRuntimeId; + $result->position = $pos->asVector3(); + $result->xRot = $xRot; + $result->yRot = $yRot; + $result->zRot = $zRot; + $result->flags = $flags; + return $result; + } + protected function decodePayload(PacketSerializer $in) : void{ $this->entityRuntimeId = $in->getEntityRuntimeId(); $this->flags = $in->getByte();