Class IndividualSpawnProvider

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

public class IndividualSpawnProvider extends Object implements ISpawnProvider
A spawn provider that selects a spawn point from a list based on
  • Field Details

  • Constructor Details

    • IndividualSpawnProvider

      public IndividualSpawnProvider()
      Empty Constructor for a IndividualSpawnProvider instance.

      Used by the codec to instantiate IndividualSpawnProvider instances.

    • IndividualSpawnProvider

      public IndividualSpawnProvider(@Nonnull Transform spawnPoint)
      Default Constructor for a IndividualSpawnProvider instance.
      Parameters:
      spawnPoint - The single spawn point to use.
    • IndividualSpawnProvider

      public IndividualSpawnProvider(@Nonnull Transform[] spawnPoints)
      Default Constructor for a IndividualSpawnProvider instance.
      Parameters:
      spawnPoints - The array of spawn points to select from.
  • Method Details

    • 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

      public Transform[] getSpawnPoints()
      Specified by:
      getSpawnPoints in interface ISpawnProvider
    • getFirstSpawnPoint

      @Nullable public Transform getFirstSpawnPoint()
    • 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.