Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getZonePatternProvider()
- getTimings()
- getGenerator(World)
- getSpawnPoints(int)
- getBenchmark()
- getDataFolder()
- getCoreData(int, int, int)
- getZonePatternGenerator(int)
- getZoneBiomeResultAt(int, int, int)
- getHeight(int, int, int)
- putHeight(int, int, int, int)
- getInterpolatedBiomeCountAt(int, int, int)
- getCave(CaveType, int, int, int)
- getPrefabLoadingCache()
- getUniquePrefabs(int)
- generate(int, long, int, int, LongPredicate, Long2FloatFunction)
- shutdown()
- generateZoneBiomeResultAt(int, int, int)
- generateZoneBiomeResultAt(int, int, int, ZoneBiomeResult)
- generateInterpolatedBiomeCountAt(int, int, int, InterpolatedBiomeCountList)
- generateLowestThresholdDependent(InterpolatedBiomeCountList)
- generateHighestThresholdDependent(InterpolatedBiomeCountList)
- generateInterpolatedThreshold(int, int, int, int, InterpolatedBiomeCountList)
- generateInterpolatedHeightNoise(InterpolatedBiomeCountList)
- generateHeight(int, int, int)
- generateHeightBetween(int, int, int, IHeightThresholdInterpreter)
- generateCave(CaveType, int, int, int)
- generateUniquePrefabs(int)
- run(int, IntObjectConsumer)
- execute(int, IntObjectFunction)
- getResource()
- isChunkOutsideGeneratableArea(int, int)
- validate()
- toMetricResults()
- toString(boolean, boolean)
- toString()
Class ChunkGenerator
java.lang.Object
com.hypixel.hytale.server.worldgen.chunk.ChunkGenerator
- All Implemented Interfaces:
MetricProvider, IBenchmarkableWorldGen, IWorldGen, ValidatableWorldGen, IWorldMapProvider
public class ChunkGenerator
extends Object
implements IBenchmarkableWorldGen, ValidatableWorldGen, MetricProvider, IWorldMapProvider
- Since:
- 22.02.2016
-
Nested Class Summary
Nested classes/interfaces inherited from interface IWorldGen
IWorldGen.Cubic, IWorldGen.SectionPriority, IWorldGen.StillNeededSection -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intTODO Replace by biome specific valuesFields inherited from interface IWorldMapProvider
CODEC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> CompletableFuture<T> execute(int seed, IntObjectFunction<ChunkGenerator, T> function) Deprecated, for removal: This API element is subject to removal in a future version.This is only here as a temporary measure to fix issues in some other deprecated code.generate(int seed, long index, int x, int z, LongPredicate stillNeeded, it.unimi.dsi.fastutil.longs.Long2FloatFunction priority) generateCave(CaveType caveType, int seed, int x, int z) Generates a cave at a certain X, Z coordinate.intgenerateHeight(int seed, int x, int z) Generates the height at a certain X, Z coordinate.intgenerateHeightBetween(int seed, int x, int z, IHeightThresholdInterpreter interpreter) intvoidgenerateInterpolatedBiomeCountAt(int seed, int x, int z, InterpolatedBiomeCountList biomeCountList) Generates a list of a count of all biomes within the given radius.doublestatic floatgenerateInterpolatedThreshold(int seed, int x, int z, int y, InterpolatedBiomeCountList biomeCounts) intgenerateUniquePrefabs(int seed) generateZoneBiomeResultAt(int seed, int x, int z) Usually only called by the ChunkGeneratorCache.generateZoneBiomeResultAt(int seed, int x, int z, ZoneBiomeResult result) Returns the cave at a certain X, Z.getCoreData(int seed, int x, int z) getGenerator(World world) intgetHeight(int seed, int x, int z) Returns the height of the block column at a certain x and z coordinategetInterpolatedBiomeCountAt(int seed, int x, int z) Proxies #generateInterpolatedBiomeCountAt(x, z) over the local BiomeCountGeneratorCache.static ChunkGeneratorResourceReturns the ChunkGeneratorResource of the current thread.getSpawnPoints(int seed) getUniquePrefabs(int seed) getZoneBiomeResultAt(int seed, int x, int z) Proxies #generateZoneBiomeResultAt(x, z) over the local ZoneBiomeGeneratorCache.getZonePatternGenerator(int seed) Returns local ZonePatternProviderbooleanisChunkOutsideGeneratableArea(int x, int z) Determines if the given chunk coordinate is outside the generatable area supported by this generator.voidputHeight(int seed, int x, int z, int y) Put a certain height into the cache.run(int seed, IntObjectConsumer<ChunkGenerator> consumer) Deprecated, for removal: This API element is subject to removal in a future version.This is only here as a temporary measure to fix issues in some other deprecated code.voidshutdown()toString()toString(boolean timings, boolean zonePatternGenerator) booleanvalidate()Methods inherited from interface IWorldGen
getDefaultSpawnProvider
-
Field Details
-
TINT_INTERPOLATION_RADIUS
public static final int TINT_INTERPOLATION_RADIUSTODO Replace by biome specific values- See Also:
-
POOL_SIZE
public static final int POOL_SIZE
-
-
Constructor Details
-
ChunkGenerator
-
-
Method Details
-
getZonePatternProvider
Returns local ZonePatternProvider- Returns:
- ZonePatternGenerator
-
getTimings
- Specified by:
getTimingsin interfaceIWorldGen
-
getGenerator
- Specified by:
getGeneratorin interfaceIWorldMapProvider- Throws:
WorldMapLoadException
-
getSpawnPoints
- Specified by:
getSpawnPointsin interfaceIWorldGen
-
getBenchmark
- Specified by:
getBenchmarkin interfaceIBenchmarkableWorldGen
-
getDataFolder
-
getCoreData
-
getZonePatternGenerator
-
getZoneBiomeResultAt
Proxies #generateZoneBiomeResultAt(x, z) over the local ZoneBiomeGeneratorCache.- Parameters:
x- X-Coordinatez- Z-Coordinate- Returns:
- ZoneBiomeResult of X and Z location
- See Also:
-
getHeight
public int getHeight(int seed, int x, int z) Returns the height of the block column at a certain x and z coordinate- Parameters:
x- X-Coordinatez- Z-Coordinate- Returns:
- Height at X, Z
- See Also:
-
putHeight
public void putHeight(int seed, int x, int z, int y) Put a certain height into the cache. This should allow some cases to not generate the height since we already have it when filling the world with layers.- Parameters:
x- X-Coordinatez- Z-Coordinatey- Height- See Also:
-
getInterpolatedBiomeCountAt
Proxies #generateInterpolatedBiomeCountAt(x, z) over the local BiomeCountGeneratorCache.- Parameters:
x- X-Coordinatez- Z-Coordinate- Returns:
- List of all biomes in interpolation radius.
- See Also:
-
getCave
-
getPrefabLoadingCache
-
getUniquePrefabs
-
generate
@Nonnull public CompletableFuture<GeneratedChunk> generate(int seed, long index, int x, int z, @Nullable LongPredicate stillNeeded, it.unimi.dsi.fastutil.longs.Long2FloatFunction priority) -
shutdown
-
generateZoneBiomeResultAt
Usually only called by the ChunkGeneratorCache. Heavy operation going through all levels of generation.- Parameters:
x- X-Coordinatez- Z-Coordinate- Returns:
- ZoneBiomeResult of X and Z location
- See Also:
-
generateZoneBiomeResultAt
@Nonnull public ZoneBiomeResult generateZoneBiomeResultAt(int seed, int x, int z, @Nonnull ZoneBiomeResult result) -
generateInterpolatedBiomeCountAt
public void generateInterpolatedBiomeCountAt(int seed, int x, int z, @Nonnull InterpolatedBiomeCountList biomeCountList) Generates a list of a count of all biomes within the given radius.- Parameters:
x- X-Coordinatez- Z-CoordinatebiomeCountList- InterpolatedBiomeCountList
-
generateLowestThresholdDependent
-
generateHighestThresholdDependent
- Parameters:
biomeCounts-- Returns:
-
generateInterpolatedThreshold
public static float generateInterpolatedThreshold(int seed, int x, int z, int y, @Nonnull InterpolatedBiomeCountList biomeCounts) -
generateInterpolatedHeightNoise
- Parameters:
biomeCounts-- Returns:
-
generateHeight
public int generateHeight(int seed, int x, int z) Generates the height at a certain X, Z coordinate. Usually only called by the ChunkGeneratorCache- Parameters:
x- X-Coordinatez- Z-Coordinate- Returns:
- Height at X, Z
- See Also:
-
generateHeightBetween
public int generateHeightBetween(int seed, int x, int z, @Nonnull IHeightThresholdInterpreter interpreter) -
generateCave
-
generateUniquePrefabs
-
run
@Deprecated(forRemoval=true, since="2026-06-16") @Nonnull public CompletableFuture<Void> run(int seed, @Nonnull IntObjectConsumer<ChunkGenerator> consumer) Deprecated, for removal: This API element is subject to removal in a future version.This is only here as a temporary measure to fix issues in some other deprecated code. Do not use.Runs the given consumer asynchronously on theChunkGenerator's executor using the specified seed and this chunk generator.- Parameters:
seed- the seed value to be supplied to the consumer.consumer- the consumer that takes the seed and the current instance of ChunkGenerator.- Returns:
- a CompletableFuture representing the result of the function execution.
-
execute
@Deprecated(forRemoval=true, since="2026-06-16") @Nonnull public <T> CompletableFuture<T> execute(int seed, @Nonnull IntObjectFunction<ChunkGenerator, T> function) Deprecated, for removal: This API element is subject to removal in a future version.This is only here as a temporary measure to fix issues in some other deprecated code. Do not use.Executes the given function asynchronously on theChunkGenerator's executor using the provided seed and this chunk generator.- Type Parameters:
T- the type of result produced by the function.- Parameters:
seed- the seed value to be passed to the function.function- a function that takes the seed and this chunk generator to produce a result.- Returns:
- a CompletableFuture representing the result of the function execution.
-
getResource
Returns the ChunkGeneratorResource of the current thread. That allows to have a very fast way to use Thread local variables and save allocations.- Returns:
- ChunkGeneratorResource of current Thread
- See Also:
-
isChunkOutsideGeneratableArea
public boolean isChunkOutsideGeneratableArea(int x, int z) Determines if the given chunk coordinate is outside the generatable area supported by this generator.- Parameters:
x- The chunk x coordinatez- The chunk z coordinate- Returns:
- true if the chunk is outside the generatable area, false if inside.
-
validate
public boolean validate()- Specified by:
validatein interfaceValidatableWorldGen
-
toMetricResults
- Specified by:
toMetricResultsin interfaceMetricProvider
-
toString
-
toString
-