Interface ISpawnProvider

All Known Implementing Classes:
FitToHeightMapSpawnProvider, GlobalSpawnProvider, IndividualSpawnProvider

public interface ISpawnProvider
An interface for providing spawn points within a world.
  • Field Details

  • Method Details

    • getSpawnPointAsync

      @Nonnull default CompletableFuture<Transform> getSpawnPointAsync(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Resolves the spawn point for the given entity reference, loading any chunk data the provider needs.
      Parameters:
      ref - The entity reference of the entity to fetch a spawn point for.
      componentAccessor - The ComponentAccessor to use for fetching components.
      Returns:
      a future completing with the spawn point Transform.
    • getSpawnPointAsync

      @Nonnull CompletableFuture<Transform> getSpawnPointAsync(@Nonnull World world, @Nonnull UUID uuid)
      Resolves the spawn point for the given world and UUID, loading any chunk data the provider needs.
      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

      @Deprecated Transform[] getSpawnPoints()
      Deprecated.
      This is limiting for spawn providers that may be able to generate new spawn points dynamically
    • isWithinSpawnDistance

      boolean isWithinSpawnDistance(@Nonnull org.joml.Vector3d position, double distance)
      Determines whether the given position is within the specified distance from the spawn point.
      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.