public abstract class ChunkGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected BiomeSource |
biomeSource |
static com.mojang.serialization.Codec<ChunkGenerator> |
CODEC |
protected BiomeSource |
populationSource
Used to control the population step without replacing the actual biome that comes from the original
biomeSource . |
private List<ChunkPos> |
strongholds |
private StructuresConfig |
structuresConfig |
private long |
worldSeed |
Constructor and Description |
---|
ChunkGenerator(BiomeSource populationSource,
BiomeSource biomeSource,
StructuresConfig structuresConfig,
long worldSeed) |
ChunkGenerator(BiomeSource biomeSource,
StructuresConfig structuresConfig) |
Modifier and Type | Method and Description |
---|---|
void |
addStructureReferences(StructureWorldAccess world,
StructureAccessor accessor,
Chunk chunk)
Finds all structures that the given chunk intersects, and adds references to their starting chunks to it.
|
abstract void |
buildSurface(ChunkRegion region,
Chunk chunk) |
void |
carve(long seed,
BiomeAccess access,
Chunk chunk,
GenerationStep.Carver carver) |
void |
generateFeatures(ChunkRegion region,
StructureAccessor accessor) |
private void |
generateStrongholdPositions() |
BiomeSource |
getBiomeSource() |
protected abstract com.mojang.serialization.Codec<? extends ChunkGenerator> |
getCodec() |
abstract BlockView |
getColumnSample(int x,
int z) |
List<SpawnSettings.SpawnEntry> |
getEntitySpawnList(Biome biome,
StructureAccessor accessor,
SpawnGroup group,
BlockPos pos) |
abstract int |
getHeight(int x,
int z,
Heightmap.Type heightmapType) |
int |
getHeightInGround(int x,
int z,
Heightmap.Type heightmapType) |
int |
getHeightOnGround(int x,
int z,
Heightmap.Type heightmapType) |
int |
getSeaLevel() |
int |
getSpawnHeight() |
StructuresConfig |
getStructuresConfig() |
int |
getWorldHeight() |
boolean |
isStrongholdStartingChunk(ChunkPos chunkPos) |
BlockPos |
locateStructure(ServerWorld world,
StructureFeature<?> feature,
BlockPos center,
int radius,
boolean skipExistingChunks)
Tries to find the closest structure of a given type near a given block.
|
void |
populateBiomes(Registry<Biome> biomeRegistry,
Chunk chunk) |
void |
populateEntities(ChunkRegion region) |
abstract void |
populateNoise(WorldAccess world,
StructureAccessor accessor,
Chunk chunk)
Generates the base shape of the chunk out of the basic block states as decided by this chunk generator's config.
|
private void |
setStructureStart(ConfiguredStructureFeature<?,?> configuredStructureFeature,
DynamicRegistryManager dynamicRegistryManager,
StructureAccessor structureAccessor,
Chunk chunk,
StructureManager structureManager,
long worldSeed,
ChunkPos chunkPos,
Biome biome) |
void |
setStructureStarts(DynamicRegistryManager dynamicRegistryManager,
StructureAccessor structureAccessor,
Chunk chunk,
StructureManager structureManager,
long worldSeed)
Determines which structures should start in the given chunk and creates their starting points.
|
abstract ChunkGenerator |
withSeed(long seed) |
public static final com.mojang.serialization.Codec<ChunkGenerator> CODEC
protected final BiomeSource populationSource
biomeSource
.
This is used by FlatChunkGenerator
to overwrite biome properties like whether lakes generate, while preserving the original biome ID.
protected final BiomeSource biomeSource
private final StructuresConfig structuresConfig
private final long worldSeed
public ChunkGenerator(BiomeSource biomeSource, StructuresConfig structuresConfig)
public ChunkGenerator(BiomeSource populationSource, BiomeSource biomeSource, StructuresConfig structuresConfig, long worldSeed)
private void generateStrongholdPositions()
protected abstract com.mojang.serialization.Codec<? extends ChunkGenerator> getCodec()
@Environment(value=CLIENT) public abstract ChunkGenerator withSeed(long seed)
public void carve(long seed, BiomeAccess access, Chunk chunk, GenerationStep.Carver carver)
@Nullable public BlockPos locateStructure(ServerWorld world, StructureFeature<?> feature, BlockPos center, int radius, boolean skipExistingChunks)
New chunks will only be generated up to the ChunkStatus.STRUCTURE_STARTS
phase by this method.
radius
- The search radius in chunks around the chunk the given block position is in. A radius of 0 will only search in the given chunk.
This is ignored for strongholds.skipExistingChunks
- whether only structures that are not referenced by generated chunks (chunks past the STRUCTURE_STARTS stage) are returned, excluding strongholdsnull
if no structure could be found within the given search radiuspublic void generateFeatures(ChunkRegion region, StructureAccessor accessor)
public abstract void buildSurface(ChunkRegion region, Chunk chunk)
public void populateEntities(ChunkRegion region)
public StructuresConfig getStructuresConfig()
public int getSpawnHeight()
public BiomeSource getBiomeSource()
public int getWorldHeight()
public List<SpawnSettings.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)
public void setStructureStarts(DynamicRegistryManager dynamicRegistryManager, StructureAccessor structureAccessor, Chunk chunk, StructureManager structureManager, long worldSeed)
private void setStructureStart(ConfiguredStructureFeature<?,?> configuredStructureFeature, DynamicRegistryManager dynamicRegistryManager, StructureAccessor structureAccessor, Chunk chunk, StructureManager structureManager, long worldSeed, ChunkPos chunkPos, Biome biome)
public void addStructureReferences(StructureWorldAccess world, StructureAccessor accessor, Chunk chunk)
public abstract void populateNoise(WorldAccess world, StructureAccessor accessor, Chunk chunk)
public int getSeaLevel()
public abstract int getHeight(int x, int z, Heightmap.Type heightmapType)
public abstract BlockView getColumnSample(int x, int z)
public int getHeightOnGround(int x, int z, Heightmap.Type heightmapType)
public int getHeightInGround(int x, int z, Heightmap.Type heightmapType)
public boolean isStrongholdStartingChunk(ChunkPos chunkPos)