13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
21 public const NETWORK_ID = ProtocolInfo::RESPAWN_PACKET;
23 public const SEARCHING_FOR_SPAWN = 0;
24 public const READY_TO_SPAWN = 1;
25 public const CLIENT_READY_TO_SPAWN = 2;
28 public int $respawnState = self::SEARCHING_FOR_SPAWN;
29 public int $actorRuntimeId;
34 public static function create(
Vector3 $position,
int $respawnState,
int $actorRuntimeId) : self{
36 $result->position = $position;
37 $result->respawnState = $respawnState;
38 $result->actorRuntimeId = $actorRuntimeId;
43 $this->position = $in->getVector3();
44 $this->respawnState = $in->
getByte();
49 $out->putVector3($this->position);
50 $out->putByte($this->respawnState);
51 $out->putActorRuntimeId($this->actorRuntimeId);
55 return $handler->handleRespawn($this);
handle(PacketHandlerInterface $handler)
decodePayload(PacketSerializer $in)
encodePayload(PacketSerializer $out)
static create(Vector3 $position, int $respawnState, int $actorRuntimeId)