Contents
Class FitToHeightMapSpawnProvider
java.lang.Object
com.hypixel.hytale.server.core.universe.world.spawn.FitToHeightMapSpawnProvider
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<FitToHeightMapSpawnProvider> The codec used to parseFitToHeightMapSpawnProviderinstances. -
Constructor Summary
ConstructorsConstructorDescriptionFitToHeightMapSpawnProvider(ISpawnProvider spawnProvider) Default Constructor for aFitToHeightMapSpawnProviderinstance. -
Method Summary
Modifier and TypeMethodDescriptiongetSpawnPointAsync(World world, 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.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 parseFitToHeightMapSpawnProviderinstances.
-
-
Constructor Details
-
FitToHeightMapSpawnProvider
Default Constructor for aFitToHeightMapSpawnProviderinstance.- 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:
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.
-