Class GlobalSpawnProvider

java.lang.Object
com.hypixel.hytale.server.core.universe.world.spawn.GlobalSpawnProvider
All Implemented Interfaces:
ISpawnProvider

public class GlobalSpawnProvider extends Object implements ISpawnProvider
A spawn provider that provides a single static spawn point for all players.
  • Field Details

  • Constructor Details

    • GlobalSpawnProvider

      public GlobalSpawnProvider()
      Empty Constructor for a GlobalSpawnProvider instance.

      Used by the codec to instantiate GlobalSpawnProvider instances.

    • GlobalSpawnProvider

      public GlobalSpawnProvider(@Nonnull Transform spawnPoint)
      Default Constructor for a GlobalSpawnProvider instance.
      Parameters:
      spawnPoint - The global spawn point.
  • Method Details

    • getGlobalSpawnPoint

      @Nonnull public Transform getGlobalSpawnPoint()
    • getSpawnPointAsync

      @Nonnull public CompletableFuture<Transform> getSpawnPointAsync(@Nonnull World world, @Nonnull UUID uuid)
      Description copied from interface: ISpawnProvider
      Resolves the spawn point for the given world and UUID, loading any chunk data the provider needs.
      Specified by:
      getSpawnPointAsync in interface ISpawnProvider
      Parameters:
      world - The world to fetch the spawn point from.
      uuid - The UUID of the entity to fetch the spawn point for.
      Returns:
      a future completing with the spawn point Transform.
    • getSpawnPoints

      @Nonnull public Transform[] getSpawnPoints()
      Specified by:
      getSpawnPoints in interface ISpawnProvider
    • isWithinSpawnDistance

      public boolean isWithinSpawnDistance(@Nonnull org.joml.Vector3d position, double distance)
      Description copied from interface: ISpawnProvider
      Determines whether the given position is within the specified distance from the spawn point.
      Specified by:
      isWithinSpawnDistance in interface ISpawnProvider
      Parameters:
      position - The position to check.
      distance - The distance from the spawn point.
      Returns:
      true if the position is within the specified distance from the spawn point, false otherwise.