Contents
Class IndividualSpawnProvider
java.lang.Object
com.hypixel.hytale.server.core.universe.world.spawn.IndividualSpawnProvider
- All Implemented Interfaces:
ISpawnProvider
A spawn provider that selects a spawn point from a list based on
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<IndividualSpawnProvider> The codec used to parseIndividualSpawnProviderinstances. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for aIndividualSpawnProviderinstance.IndividualSpawnProvider(Transform spawnPoint) Default Constructor for aIndividualSpawnProviderinstance.IndividualSpawnProvider(Transform[] spawnPoints) Default Constructor for aIndividualSpawnProviderinstance. -
Method Summary
Modifier and TypeMethodDescriptiongetSpawnPointAsync(World world, UUID uuid) Resolves the spawn point for the given world and UUID, loading any chunk data the provider needs.booleanisWithinSpawnDistance(org.joml.Vector3d position, double distance) Determines whether the given position is within the specified distance from the spawn point.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISpawnProvider
getSpawnPointAsync
-
Field Details
-
CODEC
The codec used to parseIndividualSpawnProviderinstances.
-
-
Constructor Details
-
IndividualSpawnProvider
public IndividualSpawnProvider()Empty Constructor for aIndividualSpawnProviderinstance.Used by the codec to instantiate
IndividualSpawnProviderinstances. -
IndividualSpawnProvider
Default Constructor for aIndividualSpawnProviderinstance.- Parameters:
spawnPoint- The single spawn point to use.
-
IndividualSpawnProvider
Default Constructor for aIndividualSpawnProviderinstance.- 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:ISpawnProviderResolves the spawn point for the given world and UUID, loading any chunk data the provider needs.- Specified by:
getSpawnPointAsyncin interfaceISpawnProvider- 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
- Specified by:
getSpawnPointsin interfaceISpawnProvider
-
getFirstSpawnPoint
-
isWithinSpawnDistance
public boolean isWithinSpawnDistance(@Nonnull org.joml.Vector3d position, double distance) Description copied from interface:ISpawnProviderDetermines whether the given position is within the specified distance from the spawn point.- Specified by:
isWithinSpawnDistancein interfaceISpawnProvider- Parameters:
position- The position to check.distance- The distance from the spawn point.- Returns:
trueif the position is within the specified distance from the spawn point,falseotherwise.
-