Package net.minecraft.world.gen.chunk
Class ChunkGenerator
java.lang.Object
net.minecraft.world.gen.chunk.ChunkGenerator
- Direct Known Subclasses:
DebugChunkGenerator,FlatChunkGenerator,NoiseChunkGenerator
public abstract class ChunkGenerator extends Object
In charge of shaping, adding biome specific surface blocks, and carving chunks,
as well as populating the generated chunks with features and entities.
Biome placement starts here, however all vanilla and most modded chunk generators delegate this to a biome source.
- Mappings:
Namespace Name official cjnintermediary net/minecraft/class_2794named net/minecraft/world/gen/chunk/ChunkGenerator
-
Field Summary
Fields Modifier and Type Field Description protected BiomeSourcebiomeSourcestatic com.mojang.serialization.Codec<ChunkGenerator>CODECprotected BiomeSourcepopulationSourceUsed to control the population step without replacing the actual biome that comes from the originalbiomeSource.private List<ChunkPos>strongholdsprivate StructuresConfigstructuresConfigprivate longworldSeed -
Constructor Summary
Constructors Constructor Description ChunkGenerator(BiomeSource populationSource, BiomeSource biomeSource, StructuresConfig structuresConfig, long worldSeed)ChunkGenerator(BiomeSource biomeSource, StructuresConfig structuresConfig) -
Method Summary
Modifier and Type Method Description voidaddStructureReferences(StructureWorldAccess world, StructureAccessor accessor, Chunk chunk)Finds all structures that the given chunk intersects, and adds references to their starting chunks to it.abstract voidbuildSurface(ChunkRegion region, Chunk chunk)voidcarve(long seed, BiomeAccess access, Chunk chunk, GenerationStep.Carver carver)voidgenerateFeatures(ChunkRegion region, StructureAccessor accessor)private voidgenerateStrongholdPositions()BiomeSourcegetBiomeSource()protected abstract com.mojang.serialization.Codec<? extends ChunkGenerator>getCodec()abstract VerticalBlockSamplegetColumnSample(int x, int z, HeightLimitView world)List<SpawnSettings.SpawnEntry>getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)abstract intgetHeight(int x, int z, Heightmap.Type heightmapType, HeightLimitView world)intgetHeightInGround(int x, int z, Heightmap.Type heightmapType, HeightLimitView heightLimitView)intgetHeightOnGround(int x, int z, Heightmap.Type heightmapType, HeightLimitView heightLimitView)intgetSeaLevel()intgetSpawnHeight()StructuresConfiggetStructuresConfig()intgetWorldHeight()booleanisStrongholdStartingChunk(ChunkPos pos)BlockPoslocateStructure(ServerWorld world, StructureFeature<?> feature, BlockPos center, int radius, boolean skipExistingChunks)Tries to find the closest structure of a given type near a given block.voidpopulateBiomes(Registry<Biome> biomeRegistry, Chunk chunk)voidpopulateEntities(ChunkRegion region)abstract voidpopulateNoise(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 voidsetStructureStart(ConfiguredStructureFeature<?,?> configuredStructureFeature, DynamicRegistryManager dynamicRegistryManager, StructureAccessor structureAccessor, Chunk chunk, StructureManager structureManager, long worldSeed, Biome biome)voidsetStructureStarts(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 ChunkGeneratorwithSeed(long seed)
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector official aLcjn;a:Lcom/mojang/serialization/Codec;intermediary field_24746Lnet/minecraft/class_2794;field_24746:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/world/gen/chunk/ChunkGenerator;CODEC:Lcom/mojang/serialization/Codec;
-
populationSource
Used to control the population step without replacing the actual biome that comes from the originalbiomeSource.This is used by
FlatChunkGeneratorto overwrite biome properties like whether lakes generate, while preserving the original biome ID.- Mappings:
Namespace Name Mixin selector official bLcjn;b:Lbux;intermediary field_12761Lnet/minecraft/class_2794;field_12761:Lnet/minecraft/class_1966;named populationSourceLnet/minecraft/world/gen/chunk/ChunkGenerator;populationSource:Lnet/minecraft/world/biome/source/BiomeSource;
-
biomeSource
- Mappings:
Namespace Name Mixin selector official cLcjn;c:Lbux;intermediary field_24747Lnet/minecraft/class_2794;field_24747:Lnet/minecraft/class_1966;named biomeSourceLnet/minecraft/world/gen/chunk/ChunkGenerator;biomeSource:Lnet/minecraft/world/biome/source/BiomeSource;
-
structuresConfig
- Mappings:
Namespace Name Mixin selector official dLcjn;d:Lcmx;intermediary field_16567Lnet/minecraft/class_2794;field_16567:Lnet/minecraft/class_5311;named structuresConfigLnet/minecraft/world/gen/chunk/ChunkGenerator;structuresConfig:Lnet/minecraft/world/gen/chunk/StructuresConfig;
-
worldSeed
private final long worldSeed- Mappings:
Namespace Name Mixin selector official eLcjn;e:Jintermediary field_24748Lnet/minecraft/class_2794;field_24748:Jnamed worldSeedLnet/minecraft/world/gen/chunk/ChunkGenerator;worldSeed:J
-
strongholds
- Mappings:
Namespace Name Mixin selector official fLcjn;f:Ljava/util/List;intermediary field_24749Lnet/minecraft/class_2794;field_24749:Ljava/util/List;named strongholdsLnet/minecraft/world/gen/chunk/ChunkGenerator;strongholds:Ljava/util/List;
-
-
Constructor Details
-
ChunkGenerator
- Mappings:
Namespace Name Mixin selector official <init>Lcjn;<init>(Lbux;Lcmx;)Vintermediary <init>Lnet/minecraft/class_2794;<init>(Lnet/minecraft/class_1966;Lnet/minecraft/class_5311;)Vnamed <init>Lnet/minecraft/world/gen/chunk/ChunkGenerator;<init>(Lnet/minecraft/world/biome/source/BiomeSource;Lnet/minecraft/world/gen/chunk/StructuresConfig;)V
-
ChunkGenerator
public ChunkGenerator(BiomeSource populationSource, BiomeSource biomeSource, StructuresConfig structuresConfig, long worldSeed)- Mappings:
Namespace Name Mixin selector official <init>Lcjn;<init>(Lbux;Lbux;Lcmx;J)Vintermediary <init>Lnet/minecraft/class_2794;<init>(Lnet/minecraft/class_1966;Lnet/minecraft/class_1966;Lnet/minecraft/class_5311;J)Vnamed <init>Lnet/minecraft/world/gen/chunk/ChunkGenerator;<init>(Lnet/minecraft/world/biome/source/BiomeSource;Lnet/minecraft/world/biome/source/BiomeSource;Lnet/minecraft/world/gen/chunk/StructuresConfig;J)V
-
-
Method Details
-
generateStrongholdPositions
private void generateStrongholdPositions()- Mappings:
Namespace Name Mixin selector official gLcjn;g()Vintermediary method_28509Lnet/minecraft/class_2794;method_28509()Vnamed generateStrongholdPositionsLnet/minecraft/world/gen/chunk/ChunkGenerator;generateStrongholdPositions()V
-
getCodec
- Mappings:
Namespace Name Mixin selector official aLcjn;a()Lcom/mojang/serialization/Codec;intermediary method_28506Lnet/minecraft/class_2794;method_28506()Lcom/mojang/serialization/Codec;named getCodecLnet/minecraft/world/gen/chunk/ChunkGenerator;getCodec()Lcom/mojang/serialization/Codec;
-
withSeed
- Mappings:
Namespace Name Mixin selector official aLcjn;a(J)Lcjn;intermediary method_27997Lnet/minecraft/class_2794;method_27997(J)Lnet/minecraft/class_2794;named withSeedLnet/minecraft/world/gen/chunk/ChunkGenerator;withSeed(J)Lnet/minecraft/world/gen/chunk/ChunkGenerator;
-
populateBiomes
- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lgn;Lcjl;)Vintermediary method_12106Lnet/minecraft/class_2794;method_12106(Lnet/minecraft/class_2378;Lnet/minecraft/class_2791;)Vnamed populateBiomesLnet/minecraft/world/gen/chunk/ChunkGenerator;populateBiomes(Lnet/minecraft/util/registry/Registry;Lnet/minecraft/world/chunk/Chunk;)V
-
carve
- Mappings:
Namespace Name Mixin selector official aLcjn;a(JLbuw;Lcjl;Lcmi$a;)Vintermediary method_12108Lnet/minecraft/class_2794;method_12108(JLnet/minecraft/class_4543;Lnet/minecraft/class_2791;Lnet/minecraft/class_2893$class_2894;)Vnamed carveLnet/minecraft/world/gen/chunk/ChunkGenerator;carve(JLnet/minecraft/world/biome/source/BiomeAccess;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/world/gen/GenerationStep$Carver;)V
-
locateStructure
@Nullable public 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.New chunks will only be generated up to the
ChunkStatus.STRUCTURE_STARTSphase by this method.- Parameters:
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 strongholds- Returns:
nullif no structure could be found within the given search radius- Mappings:
Namespace Name Mixin selector official aLcjn;a(Laav;Lcqj;Lfx;IZ)Lfx;intermediary method_12103Lnet/minecraft/class_2794;method_12103(Lnet/minecraft/class_3218;Lnet/minecraft/class_3195;Lnet/minecraft/class_2338;IZ)Lnet/minecraft/class_2338;named locateStructureLnet/minecraft/world/gen/chunk/ChunkGenerator;locateStructure(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/world/gen/feature/StructureFeature;Lnet/minecraft/util/math/BlockPos;IZ)Lnet/minecraft/util/math/BlockPos;
-
generateFeatures
- Mappings:
Namespace Name Mixin selector official aLcjn;a(Labb;Lbum;)Vintermediary method_12102Lnet/minecraft/class_2794;method_12102(Lnet/minecraft/class_3233;Lnet/minecraft/class_5138;)Vnamed generateFeaturesLnet/minecraft/world/gen/chunk/ChunkGenerator;generateFeatures(Lnet/minecraft/world/ChunkRegion;Lnet/minecraft/world/gen/StructureAccessor;)V
-
buildSurface
- Mappings:
Namespace Name Mixin selector official aLcjn;a(Labb;Lcjl;)Vintermediary method_12110Lnet/minecraft/class_2794;method_12110(Lnet/minecraft/class_3233;Lnet/minecraft/class_2791;)Vnamed buildSurfaceLnet/minecraft/world/gen/chunk/ChunkGenerator;buildSurface(Lnet/minecraft/world/ChunkRegion;Lnet/minecraft/world/chunk/Chunk;)V
-
populateEntities
- Mappings:
Namespace Name Mixin selector official aLcjn;a(Labb;)Vintermediary method_12107Lnet/minecraft/class_2794;method_12107(Lnet/minecraft/class_3233;)Vnamed populateEntitiesLnet/minecraft/world/gen/chunk/ChunkGenerator;populateEntities(Lnet/minecraft/world/ChunkRegion;)V
-
getStructuresConfig
- Mappings:
Namespace Name Mixin selector official bLcjn;b()Lcmx;intermediary method_12109Lnet/minecraft/class_2794;method_12109()Lnet/minecraft/class_5311;named getStructuresConfigLnet/minecraft/world/gen/chunk/ChunkGenerator;getStructuresConfig()Lnet/minecraft/world/gen/chunk/StructuresConfig;
-
getSpawnHeight
public int getSpawnHeight()- Mappings:
Namespace Name Mixin selector official cLcjn;c()Iintermediary method_12100Lnet/minecraft/class_2794;method_12100()Inamed getSpawnHeightLnet/minecraft/world/gen/chunk/ChunkGenerator;getSpawnHeight()I
-
getBiomeSource
- Mappings:
Namespace Name Mixin selector official dLcjn;d()Lbux;intermediary method_12098Lnet/minecraft/class_2794;method_12098()Lnet/minecraft/class_1966;named getBiomeSourceLnet/minecraft/world/gen/chunk/ChunkGenerator;getBiomeSource()Lnet/minecraft/world/biome/source/BiomeSource;
-
getWorldHeight
public int getWorldHeight()- Mappings:
Namespace Name Mixin selector official eLcjn;e()Iintermediary method_12104Lnet/minecraft/class_2794;method_12104()Inamed getWorldHeightLnet/minecraft/world/gen/chunk/ChunkGenerator;getWorldHeight()I
-
getEntitySpawnList
public List<SpawnSettings.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lbuu;Lbum;Lark;Lfx;)Ljava/util/List;intermediary method_12113Lnet/minecraft/class_2794;method_12113(Lnet/minecraft/class_1959;Lnet/minecraft/class_5138;Lnet/minecraft/class_1311;Lnet/minecraft/class_2338;)Ljava/util/List;named getEntitySpawnListLnet/minecraft/world/gen/chunk/ChunkGenerator;getEntitySpawnList(Lnet/minecraft/world/biome/Biome;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/util/math/BlockPos;)Ljava/util/List;
-
setStructureStarts
public 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.- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lgo;Lbum;Lcjl;Lcyj;J)Vintermediary method_16129Lnet/minecraft/class_2794;method_16129(Lnet/minecraft/class_5455;Lnet/minecraft/class_5138;Lnet/minecraft/class_2791;Lnet/minecraft/class_3485;J)Vnamed setStructureStartsLnet/minecraft/world/gen/chunk/ChunkGenerator;setStructureStarts(Lnet/minecraft/util/registry/DynamicRegistryManager;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/structure/StructureManager;J)V
-
setStructureStart
private void setStructureStart(ConfiguredStructureFeature<?,?> configuredStructureFeature, DynamicRegistryManager dynamicRegistryManager, StructureAccessor structureAccessor, Chunk chunk, StructureManager structureManager, long worldSeed, Biome biome)- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lcny;Lgo;Lbum;Lcjl;Lcyj;JLbuu;)Vintermediary method_28508Lnet/minecraft/class_2794;method_28508(Lnet/minecraft/class_5312;Lnet/minecraft/class_5455;Lnet/minecraft/class_5138;Lnet/minecraft/class_2791;Lnet/minecraft/class_3485;JLnet/minecraft/class_1959;)Vnamed setStructureStartLnet/minecraft/world/gen/chunk/ChunkGenerator;setStructureStart(Lnet/minecraft/world/gen/feature/ConfiguredStructureFeature;Lnet/minecraft/util/registry/DynamicRegistryManager;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/structure/StructureManager;JLnet/minecraft/world/biome/Biome;)V
-
addStructureReferences
public 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. A radius of 8 chunks around the given chunk will be searched for structure starts.- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lbuq;Lbum;Lcjl;)Vintermediary method_16130Lnet/minecraft/class_2794;method_16130(Lnet/minecraft/class_5281;Lnet/minecraft/class_5138;Lnet/minecraft/class_2791;)Vnamed addStructureReferencesLnet/minecraft/world/gen/chunk/ChunkGenerator;addStructureReferences(Lnet/minecraft/world/StructureWorldAccess;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/world/chunk/Chunk;)V
-
populateNoise
Generates the base shape of the chunk out of the basic block states as decided by this chunk generator's config.- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lbtw;Lbum;Lcjl;)Vintermediary method_12088Lnet/minecraft/class_2794;method_12088(Lnet/minecraft/class_1936;Lnet/minecraft/class_5138;Lnet/minecraft/class_2791;)Vnamed populateNoiseLnet/minecraft/world/gen/chunk/ChunkGenerator;populateNoise(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/world/chunk/Chunk;)V
-
getSeaLevel
public int getSeaLevel()- Mappings:
Namespace Name Mixin selector official fLcjn;f()Iintermediary method_16398Lnet/minecraft/class_2794;method_16398()Inamed getSeaLevelLnet/minecraft/world/gen/chunk/ChunkGenerator;getSeaLevel()I
-
getHeight
- Mappings:
Namespace Name Mixin selector official aLcjn;a(IILcmm$a;Lbtx;)Iintermediary method_16397Lnet/minecraft/class_2794;method_16397(IILnet/minecraft/class_2902$class_2903;Lnet/minecraft/class_5539;)Inamed getHeightLnet/minecraft/world/gen/chunk/ChunkGenerator;getHeight(IILnet/minecraft/world/Heightmap$Type;Lnet/minecraft/world/HeightLimitView;)I
-
getColumnSample
- Mappings:
Namespace Name Mixin selector official aLcjn;a(IILbtx;)Lbug;intermediary method_26261Lnet/minecraft/class_2794;method_26261(IILnet/minecraft/class_5539;)Lnet/minecraft/class_4966;named getColumnSampleLnet/minecraft/world/gen/chunk/ChunkGenerator;getColumnSample(IILnet/minecraft/world/HeightLimitView;)Lnet/minecraft/world/gen/chunk/VerticalBlockSample;
-
getHeightOnGround
public int getHeightOnGround(int x, int z, Heightmap.Type heightmapType, HeightLimitView heightLimitView)- Mappings:
Namespace Name Mixin selector official bLcjn;b(IILcmm$a;Lbtx;)Iintermediary method_20402Lnet/minecraft/class_2794;method_20402(IILnet/minecraft/class_2902$class_2903;Lnet/minecraft/class_5539;)Inamed getHeightOnGroundLnet/minecraft/world/gen/chunk/ChunkGenerator;getHeightOnGround(IILnet/minecraft/world/Heightmap$Type;Lnet/minecraft/world/HeightLimitView;)I
-
getHeightInGround
public int getHeightInGround(int x, int z, Heightmap.Type heightmapType, HeightLimitView heightLimitView)- Mappings:
Namespace Name Mixin selector official cLcjn;c(IILcmm$a;Lbtx;)Iintermediary method_18028Lnet/minecraft/class_2794;method_18028(IILnet/minecraft/class_2902$class_2903;Lnet/minecraft/class_5539;)Inamed getHeightInGroundLnet/minecraft/world/gen/chunk/ChunkGenerator;getHeightInGround(IILnet/minecraft/world/Heightmap$Type;Lnet/minecraft/world/HeightLimitView;)I
-
isStrongholdStartingChunk
- Mappings:
Namespace Name Mixin selector official aLcjn;a(Lbta;)Zintermediary method_28507Lnet/minecraft/class_2794;method_28507(Lnet/minecraft/class_1923;)Znamed isStrongholdStartingChunkLnet/minecraft/world/gen/chunk/ChunkGenerator;isStrongholdStartingChunk(Lnet/minecraft/util/math/ChunkPos;)Z
-