22 public const NETWORK_ID = ProtocolInfo::SET_SPAWN_POSITION_PACKET;
24 public const TYPE_PLAYER_SPAWN = 0;
25 public const TYPE_WORLD_SPAWN = 1;
27 public int $spawnType;
29 public int $dimension;
42 $result->spawnType = $spawnType;
43 $result->spawnPosition = $spawnPosition;
44 $result->dimension = $dimension;
50 return self::create(self::TYPE_PLAYER_SPAWN, $spawnPosition, $dimension, $causingBlockPosition);
53 public static function worldSpawn(
BlockPosition $spawnPosition,
int $dimension) : self{
54 return self::create(self::TYPE_WORLD_SPAWN, $spawnPosition, $dimension, new
BlockPosition(Limits::INT32_MIN, Limits::INT32_MIN, Limits::INT32_MIN));
58 $this->spawnType = $in->getVarInt();
65 $out->putVarInt($this->spawnType);
72 return $handler->handleSetSpawnPosition($this);