Contents
Class GlobalSpawnProvider
java.lang.Object
com.hypixel.hytale.server.core.universe.world.spawn.GlobalSpawnProvider
- All Implemented Interfaces:
ISpawnProvider
A spawn provider that provides a single static spawn point for all players.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<GlobalSpawnProvider> The codec used to parseGlobalSpawnProviderinstances. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for aGlobalSpawnProviderinstance.GlobalSpawnProvider(Transform spawnPoint) Default Constructor for aGlobalSpawnProviderinstance. -
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 parseGlobalSpawnProviderinstances.
-
-
Constructor Details
-
GlobalSpawnProvider
public GlobalSpawnProvider()Empty Constructor for aGlobalSpawnProviderinstance.Used by the codec to instantiate
GlobalSpawnProviderinstances. -
GlobalSpawnProvider
Default Constructor for aGlobalSpawnProviderinstance.- Parameters:
spawnPoint- The global spawn point.
-
-
Method Details
-
getGlobalSpawnPoint
-
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
-
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.
-