MoveActorAbsolutePacket: added ::create() method

This commit is contained in:
Dylan K. Taylor 2020-10-06 18:34:38 +01:00
parent 69cad3e694
commit d8ee657d20

View File

@ -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();