Class FitToHeightMapSpawnProvider

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

public class FitToHeightMapSpawnProvider extends Object implements ISpawnProvider
A spawn provider that takes a spawn point from another provider and, when its Y is HeightmapColumn.NO_HEIGHT, places it one block above the column's heightmap top.
  • Field Details

  • Constructor Details

    • FitToHeightMapSpawnProvider

      public FitToHeightMapSpawnProvider(@Nonnull ISpawnProvider spawnProvider)
      Default Constructor for a FitToHeightMapSpawnProvider instance.
      Parameters:
      spawnProvider - The target spawn provider to take the initial spawn point from.
  • Method Details

    • getSpawnPointAsync

      @Nonnull public CompletableFuture<Transform> getSpawnPointAsync(@Nonnull World world, @Nonnull UUID uuid)
      Completes immediately when the spawn column is resident and otherwise once it has loaded, so callers that join on the result only wait for a load.
      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
    • 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.