Package net.minecraft.world.level.chunk
Class ChunkGenerator
java.lang.Object
net.minecraft.world.level.chunk.ChunkGenerator
- All Implemented Interfaces:
BiomeManager.NoiseBiomeSource
- Direct Known Subclasses:
DebugLevelSource
,FlatLevelSource
,NoiseBasedChunkGenerator
-
Field Summary
Modifier and TypeFieldDescriptionprotected final BiomeSource
static final com.mojang.serialization.Codec<ChunkGenerator>
private boolean
private static final org.slf4j.Logger
private final Map<ConfiguredStructureFeature<?,
?>, List<StructurePlacement>> private final long
Deprecated.private final Map<ConcentricRingsStructurePlacement,
CompletableFuture<List<ChunkPos>>> protected final BiomeSource
protected final Optional<HolderSet<StructureSet>>
protected final Registry<StructureSet>
-
Constructor Summary
ConstructorDescriptionChunkGenerator
(Registry<StructureSet> p_207960_, Optional<HolderSet<StructureSet>> p_207961_, BiomeSource p_207962_) ChunkGenerator
(Registry<StructureSet> p_207964_, Optional<HolderSet<StructureSet>> p_207965_, BiomeSource p_207966_, BiomeSource p_207967_, long p_207968_) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
addDebugScreenInfo
(List<String> p_208054_, BlockPos p_208055_) adjustBiome
(Holder<Biome> p_204385_) static Stream<ConfiguredStructureFeature<?,
?>> allConfigurations
(Registry<ConfiguredStructureFeature<?, ?>> p_208045_, StructureFeature<?> p_208046_) void
applyBiomeDecoration
(WorldGenLevel p_187712_, ChunkAccess p_187713_, StructureFeatureManager p_187714_) abstract void
applyCarvers
(WorldGenRegion p_187691_, long p_187692_, BiomeManager p_187693_, StructureFeatureManager p_187694_, ChunkAccess p_187695_, GenerationStep.Carving p_187696_) abstract void
buildSurface
(WorldGenRegion p_187697_, StructureFeatureManager p_187698_, ChunkAccess p_187699_) abstract Climate.Sampler
protected abstract com.mojang.serialization.Codec<? extends ChunkGenerator>
codec()
protected static final <T extends ChunkGenerator>
com.mojang.datafixers.Products.P1<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>,Registry<StructureSet>> commonCodec
(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> p_208006_) createBiomes
(Registry<Biome> p_196743_, Executor p_196744_, Blender p_196745_, StructureFeatureManager p_196746_, ChunkAccess p_196747_) void
createReferences
(WorldGenLevel p_62178_, StructureFeatureManager p_62179_, ChunkAccess p_62180_) void
createStructures
(RegistryAccess p_62200_, StructureFeatureManager p_62201_, ChunkAccess p_62202_, StructureManager p_62203_, long p_62204_) void
private static int
fetchReferences
(StructureFeatureManager p_207977_, ChunkAccess p_207978_, SectionPos p_207979_, ConfiguredStructureFeature<?, ?> p_207980_) abstract CompletableFuture<ChunkAccess>
fillFromNoise
(Executor p_187748_, Blender p_187749_, StructureFeatureManager p_187750_, ChunkAccess p_187751_) com.mojang.datafixers.util.Pair<BlockPos,
Holder<ConfiguredStructureFeature<?, ?>>> findNearestMapFeature
(ServerLevel p_207971_, HolderSet<ConfiguredStructureFeature<?, ?>> p_207972_, BlockPos p_207973_, int p_207974_, boolean p_207975_) private void
private CompletableFuture<List<ChunkPos>>
generateRingPositions
(Holder<StructureSet> p_211668_, ConcentricRingsStructurePlacement p_211669_) abstract NoiseColumn
getBaseColumn
(int p_156150_, int p_156151_, LevelHeightAccessor p_156152_) abstract int
getBaseHeight
(int p_156153_, int p_156154_, Heightmap.Types p_156155_, LevelHeightAccessor p_156156_) int
getFirstFreeHeight
(int p_156175_, int p_156176_, Heightmap.Types p_156177_, LevelHeightAccessor p_156178_) int
getFirstOccupiedHeight
(int p_156180_, int p_156181_, Heightmap.Types p_156182_, LevelHeightAccessor p_156183_) abstract int
abstract int
getMinY()
getMobsAt
(Holder<Biome> p_204386_, StructureFeatureManager p_204387_, MobCategory p_204388_, BlockPos p_204389_) private static com.mojang.datafixers.util.Pair<BlockPos,
Holder<ConfiguredStructureFeature<?, ?>>> getNearestGeneratedStructure
(Set<Holder<ConfiguredStructureFeature<?, ?>>> p_208060_, LevelReader p_208061_, StructureFeatureManager p_208062_, int p_208063_, int p_208064_, int p_208065_, boolean p_208066_, long p_208067_, RandomSpreadStructurePlacement p_208068_) private BlockPos
getNearestGeneratedStructure
(BlockPos p_204383_, ConcentricRingsStructurePlacement p_204384_) getNoiseBiome
(int p_204416_, int p_204417_, int p_204418_) private List<StructurePlacement>
getPlacementsForFeature
(Holder<ConfiguredStructureFeature<?, ?>> p_208091_) abstract int
int
getSpawnHeight
(LevelHeightAccessor p_156157_) Optional<ResourceKey<com.mojang.serialization.Codec<? extends ChunkGenerator>>>
private static BoundingBox
getWritableArea
(ChunkAccess p_187718_) boolean
hasFeatureChunkInRange
(ResourceKey<StructureSet> p_212266_, long p_212267_, int p_212268_, int p_212269_, int p_212270_) abstract void
spawnOriginalMobs
(WorldGenRegion p_62167_) private boolean
tryGenerateStructure
(StructureSet.StructureSelectionEntry p_208017_, StructureFeatureManager p_208018_, RegistryAccess p_208019_, StructureManager p_208020_, long p_208021_, ChunkAccess p_208022_, ChunkPos p_208023_, SectionPos p_208024_) abstract ChunkGenerator
withSeed
(long p_62156_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
structureSets
-
biomeSource
-
runtimeBiomeSource
-
structureOverrides
-
placementsForFeature
-
ringPositions
private final Map<ConcentricRingsStructurePlacement,CompletableFuture<List<ChunkPos>>> ringPositions -
hasGeneratedPositions
private boolean hasGeneratedPositions -
ringPlacementSeed
Deprecated.
-
-
Constructor Details
-
ChunkGenerator
public ChunkGenerator(Registry<StructureSet> p_207960_, Optional<HolderSet<StructureSet>> p_207961_, BiomeSource p_207962_) -
ChunkGenerator
public ChunkGenerator(Registry<StructureSet> p_207964_, Optional<HolderSet<StructureSet>> p_207965_, BiomeSource p_207966_, BiomeSource p_207967_, long p_207968_)
-
-
Method Details
-
commonCodec
protected static final <T extends ChunkGenerator> com.mojang.datafixers.Products.P1<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>,Registry<StructureSet>> commonCodec(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> p_208006_) -
possibleStructureSets
-
generatePositions
private void generatePositions() -
generateRingPositions
private CompletableFuture<List<ChunkPos>> generateRingPositions(Holder<StructureSet> p_211668_, ConcentricRingsStructurePlacement p_211669_) -
codec
-
getTypeNameForDataFixer
public Optional<ResourceKey<com.mojang.serialization.Codec<? extends ChunkGenerator>>> getTypeNameForDataFixer() -
withSeed
-
createBiomes
public CompletableFuture<ChunkAccess> createBiomes(Registry<Biome> p_196743_, Executor p_196744_, Blender p_196745_, StructureFeatureManager p_196746_, ChunkAccess p_196747_) -
climateSampler
-
getNoiseBiome
- Specified by:
getNoiseBiome
in interfaceBiomeManager.NoiseBiomeSource
-
applyCarvers
public abstract void applyCarvers(WorldGenRegion p_187691_, long p_187692_, BiomeManager p_187693_, StructureFeatureManager p_187694_, ChunkAccess p_187695_, GenerationStep.Carving p_187696_) -
findNearestMapFeature
@Nullable public com.mojang.datafixers.util.Pair<BlockPos,Holder<ConfiguredStructureFeature<?, findNearestMapFeature?>>> (ServerLevel p_207971_, HolderSet<ConfiguredStructureFeature<?, ?>> p_207972_, BlockPos p_207973_, int p_207974_, boolean p_207975_) -
getNearestGeneratedStructure
@Nullable private BlockPos getNearestGeneratedStructure(BlockPos p_204383_, ConcentricRingsStructurePlacement p_204384_) -
getNearestGeneratedStructure
@Nullable private static com.mojang.datafixers.util.Pair<BlockPos,Holder<ConfiguredStructureFeature<?, getNearestGeneratedStructure?>>> (Set<Holder<ConfiguredStructureFeature<?, ?>>> p_208060_, LevelReader p_208061_, StructureFeatureManager p_208062_, int p_208063_, int p_208064_, int p_208065_, boolean p_208066_, long p_208067_, RandomSpreadStructurePlacement p_208068_) -
applyBiomeDecoration
public void applyBiomeDecoration(WorldGenLevel p_187712_, ChunkAccess p_187713_, StructureFeatureManager p_187714_) -
hasFeatureChunkInRange
public boolean hasFeatureChunkInRange(ResourceKey<StructureSet> p_212266_, long p_212267_, int p_212268_, int p_212269_, int p_212270_) -
getWritableArea
-
buildSurface
public abstract void buildSurface(WorldGenRegion p_187697_, StructureFeatureManager p_187698_, ChunkAccess p_187699_) -
spawnOriginalMobs
-
getSpawnHeight
-
getBiomeSource
-
getGenDepth
public abstract int getGenDepth() -
getMobsAt
public WeightedRandomList<MobSpawnSettings.SpawnerData> getMobsAt(Holder<Biome> p_204386_, StructureFeatureManager p_204387_, MobCategory p_204388_, BlockPos p_204389_) -
allConfigurations
public static Stream<ConfiguredStructureFeature<?,?>> allConfigurations(Registry<ConfiguredStructureFeature<?, ?>> p_208045_, StructureFeature<?> p_208046_) -
createStructures
public void createStructures(RegistryAccess p_62200_, StructureFeatureManager p_62201_, ChunkAccess p_62202_, StructureManager p_62203_, long p_62204_) -
tryGenerateStructure
private boolean tryGenerateStructure(StructureSet.StructureSelectionEntry p_208017_, StructureFeatureManager p_208018_, RegistryAccess p_208019_, StructureManager p_208020_, long p_208021_, ChunkAccess p_208022_, ChunkPos p_208023_, SectionPos p_208024_) -
fetchReferences
private static int fetchReferences(StructureFeatureManager p_207977_, ChunkAccess p_207978_, SectionPos p_207979_, ConfiguredStructureFeature<?, ?> p_207980_) -
adjustBiome
-
createReferences
public void createReferences(WorldGenLevel p_62178_, StructureFeatureManager p_62179_, ChunkAccess p_62180_) -
fillFromNoise
public abstract CompletableFuture<ChunkAccess> fillFromNoise(Executor p_187748_, Blender p_187749_, StructureFeatureManager p_187750_, ChunkAccess p_187751_) -
getSeaLevel
public abstract int getSeaLevel() -
getMinY
public abstract int getMinY() -
getBaseHeight
public abstract int getBaseHeight(int p_156153_, int p_156154_, Heightmap.Types p_156155_, LevelHeightAccessor p_156156_) -
getBaseColumn
public abstract NoiseColumn getBaseColumn(int p_156150_, int p_156151_, LevelHeightAccessor p_156152_) -
getFirstFreeHeight
public int getFirstFreeHeight(int p_156175_, int p_156176_, Heightmap.Types p_156177_, LevelHeightAccessor p_156178_) -
getFirstOccupiedHeight
public int getFirstOccupiedHeight(int p_156180_, int p_156181_, Heightmap.Types p_156182_, LevelHeightAccessor p_156183_) -
ensureStructuresGenerated
public void ensureStructuresGenerated() -
getRingPositionsFor
-
getPlacementsForFeature
private List<StructurePlacement> getPlacementsForFeature(Holder<ConfiguredStructureFeature<?, ?>> p_208091_) -
addDebugScreenInfo
-