Package net.minecraft.world.level.chunk
Class ChunkGenerator
java.lang.Object
net.minecraft.world.level.chunk.ChunkGenerator
- Direct Known Subclasses:
DebugLevelSource
,FlatLevelSource
,NoiseBasedChunkGenerator
-
Field Summary
Modifier and TypeFieldDescriptionprotected final BiomeSource
static final com.mojang.serialization.Codec<ChunkGenerator>
private final Supplier<List<FeatureSorter.StepFeatureData>>
private final Function<Holder<Biome>,
BiomeGenerationSettings> private boolean
private static final org.slf4j.Logger
private final Map<Structure,
List<StructurePlacement>> private final Map<ConcentricRingsStructurePlacement,
CompletableFuture<List<ChunkPos>>> 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_223024_, Optional<HolderSet<StructureSet>> p_223025_, BiomeSource p_223026_, Function<Holder<Biome>, BiomeGenerationSettings> p_223027_) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
addDebugScreenInfo
(List<String> p_223175_, RandomState p_223176_, BlockPos p_223177_) void
applyBiomeDecoration
(WorldGenLevel p_223087_, ChunkAccess p_223088_, StructureManager p_223089_) abstract void
applyCarvers
(WorldGenRegion p_223043_, long p_223044_, RandomState p_223045_, BiomeManager p_223046_, StructureManager p_223047_, ChunkAccess p_223048_, GenerationStep.Carving p_223049_) abstract void
buildSurface
(WorldGenRegion p_223050_, StructureManager p_223051_, RandomState p_223052_, ChunkAccess p_223053_) protected abstract com.mojang.serialization.Codec<? extends ChunkGenerator>
codec()
protected static <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_223158_, Executor p_223159_, RandomState p_223160_, Blender p_223161_, StructureManager p_223162_, ChunkAccess p_223163_) void
createReferences
(WorldGenLevel p_223077_, StructureManager p_223078_, ChunkAccess p_223079_) void
createStructures
(RegistryAccess p_223165_, RandomState p_223166_, StructureManager p_223167_, ChunkAccess p_223168_, StructureTemplateManager p_223169_, long p_223170_) void
ensureStructuresGenerated
(RandomState p_223101_) private static int
fetchReferences
(StructureManager p_223055_, ChunkAccess p_223056_, SectionPos p_223057_, Structure p_223058_) abstract CompletableFuture<ChunkAccess>
fillFromNoise
(Executor p_223209_, Blender p_223210_, RandomState p_223211_, StructureManager p_223212_, ChunkAccess p_223213_) findNearestMapStructure
(ServerLevel p_223038_, HolderSet<Structure> p_223039_, BlockPos p_223040_, int p_223041_, boolean p_223042_) private void
generatePositions
(RandomState p_223228_) private CompletableFuture<List<ChunkPos>>
generateRingPositions
(Holder<StructureSet> p_223149_, RandomState p_223150_, ConcentricRingsStructurePlacement p_223151_) abstract NoiseColumn
getBaseColumn
(int p_223028_, int p_223029_, LevelHeightAccessor p_223030_, RandomState p_223031_) abstract int
getBaseHeight
(int p_223032_, int p_223033_, Heightmap.Types p_223034_, LevelHeightAccessor p_223035_, RandomState p_223036_) getBiomeGenerationSettings
(Holder<Biome> p_223132_) Deprecated.int
getFirstFreeHeight
(int p_223222_, int p_223223_, Heightmap.Types p_223224_, LevelHeightAccessor p_223225_, RandomState p_223226_) int
getFirstOccupiedHeight
(int p_223236_, int p_223237_, Heightmap.Types p_223238_, LevelHeightAccessor p_223239_, RandomState p_223240_) abstract int
abstract int
getMinY()
getMobsAt
(Holder<Biome> p_223134_, StructureManager p_223135_, MobCategory p_223136_, BlockPos p_223137_) getNearestGeneratedStructure
(Set<Holder<Structure>> p_223182_, ServerLevel p_223183_, StructureManager p_223184_, BlockPos p_223185_, boolean p_223186_, ConcentricRingsStructurePlacement p_223187_) getNearestGeneratedStructure
(Set<Holder<Structure>> p_223189_, LevelReader p_223190_, StructureManager p_223191_, int p_223192_, int p_223193_, int p_223194_, boolean p_223195_, long p_223196_, RandomSpreadStructurePlacement p_223197_) private List<StructurePlacement>
getPlacementsForStructure
(Holder<Structure> p_223139_, RandomState p_223140_) getRingPositionsFor
(ConcentricRingsStructurePlacement p_223120_, RandomState p_223121_) abstract int
int
getSpawnHeight
(LevelHeightAccessor p_156157_) getStructureGeneratingAt
(Set<Holder<Structure>> p_223199_, LevelReader p_223200_, StructureManager p_223201_, boolean p_223202_, StructurePlacement p_223203_, ChunkPos p_223204_) Optional<ResourceKey<com.mojang.serialization.Codec<? extends ChunkGenerator>>>
private static BoundingBox
getWritableArea
(ChunkAccess p_187718_) boolean
hasStructureChunkInRange
(Holder<StructureSet> p_223142_, RandomState p_223143_, long p_223144_, int p_223145_, int p_223146_, int p_223147_) abstract void
spawnOriginalMobs
(WorldGenRegion p_62167_) private static boolean
tryAddReference
(StructureManager p_223060_, StructureStart p_223061_) private boolean
tryGenerateStructure
(StructureSet.StructureSelectionEntry p_223105_, StructureManager p_223106_, RegistryAccess p_223107_, RandomState p_223108_, StructureTemplateManager p_223109_, long p_223110_, ChunkAccess p_223111_, ChunkPos p_223112_, SectionPos p_223113_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
structureSets
-
biomeSource
-
featuresPerStep
-
structureOverrides
-
generationSettingsGetter
-
placementsForStructure
-
ringPositions
private final Map<ConcentricRingsStructurePlacement,CompletableFuture<List<ChunkPos>>> ringPositions -
hasGeneratedPositions
private boolean hasGeneratedPositions
-
-
Constructor Details
-
ChunkGenerator
public ChunkGenerator(Registry<StructureSet> p_207960_, Optional<HolderSet<StructureSet>> p_207961_, BiomeSource p_207962_) -
ChunkGenerator
public ChunkGenerator(Registry<StructureSet> p_223024_, Optional<HolderSet<StructureSet>> p_223025_, BiomeSource p_223026_, Function<Holder<Biome>, BiomeGenerationSettings> p_223027_)
-
-
Method Details
-
commonCodec
protected static <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
-
generateRingPositions
private CompletableFuture<List<ChunkPos>> generateRingPositions(Holder<StructureSet> p_223149_, RandomState p_223150_, ConcentricRingsStructurePlacement p_223151_) -
codec
-
getTypeNameForDataFixer
public Optional<ResourceKey<com.mojang.serialization.Codec<? extends ChunkGenerator>>> getTypeNameForDataFixer() -
createBiomes
public CompletableFuture<ChunkAccess> createBiomes(Registry<Biome> p_223158_, Executor p_223159_, RandomState p_223160_, Blender p_223161_, StructureManager p_223162_, ChunkAccess p_223163_) -
applyCarvers
public abstract void applyCarvers(WorldGenRegion p_223043_, long p_223044_, RandomState p_223045_, BiomeManager p_223046_, StructureManager p_223047_, ChunkAccess p_223048_, GenerationStep.Carving p_223049_) -
findNearestMapStructure
-
getNearestGeneratedStructure
@Nullable private com.mojang.datafixers.util.Pair<BlockPos,Holder<Structure>> getNearestGeneratedStructure(Set<Holder<Structure>> p_223182_, ServerLevel p_223183_, StructureManager p_223184_, BlockPos p_223185_, boolean p_223186_, ConcentricRingsStructurePlacement p_223187_) -
getNearestGeneratedStructure
@Nullable private static com.mojang.datafixers.util.Pair<BlockPos,Holder<Structure>> getNearestGeneratedStructure(Set<Holder<Structure>> p_223189_, LevelReader p_223190_, StructureManager p_223191_, int p_223192_, int p_223193_, int p_223194_, boolean p_223195_, long p_223196_, RandomSpreadStructurePlacement p_223197_) -
getStructureGeneratingAt
@Nullable private static com.mojang.datafixers.util.Pair<BlockPos,Holder<Structure>> getStructureGeneratingAt(Set<Holder<Structure>> p_223199_, LevelReader p_223200_, StructureManager p_223201_, boolean p_223202_, StructurePlacement p_223203_, ChunkPos p_223204_) -
tryAddReference
-
applyBiomeDecoration
public void applyBiomeDecoration(WorldGenLevel p_223087_, ChunkAccess p_223088_, StructureManager p_223089_) -
hasStructureChunkInRange
public boolean hasStructureChunkInRange(Holder<StructureSet> p_223142_, RandomState p_223143_, long p_223144_, int p_223145_, int p_223146_, int p_223147_) -
getWritableArea
-
buildSurface
public abstract void buildSurface(WorldGenRegion p_223050_, StructureManager p_223051_, RandomState p_223052_, ChunkAccess p_223053_) -
spawnOriginalMobs
-
getSpawnHeight
-
getBiomeSource
-
getGenDepth
public abstract int getGenDepth() -
getMobsAt
public WeightedRandomList<MobSpawnSettings.SpawnerData> getMobsAt(Holder<Biome> p_223134_, StructureManager p_223135_, MobCategory p_223136_, BlockPos p_223137_) -
createStructures
public void createStructures(RegistryAccess p_223165_, RandomState p_223166_, StructureManager p_223167_, ChunkAccess p_223168_, StructureTemplateManager p_223169_, long p_223170_) -
tryGenerateStructure
private boolean tryGenerateStructure(StructureSet.StructureSelectionEntry p_223105_, StructureManager p_223106_, RegistryAccess p_223107_, RandomState p_223108_, StructureTemplateManager p_223109_, long p_223110_, ChunkAccess p_223111_, ChunkPos p_223112_, SectionPos p_223113_) -
fetchReferences
private static int fetchReferences(StructureManager p_223055_, ChunkAccess p_223056_, SectionPos p_223057_, Structure p_223058_) -
createReferences
public void createReferences(WorldGenLevel p_223077_, StructureManager p_223078_, ChunkAccess p_223079_) -
fillFromNoise
public abstract CompletableFuture<ChunkAccess> fillFromNoise(Executor p_223209_, Blender p_223210_, RandomState p_223211_, StructureManager p_223212_, ChunkAccess p_223213_) -
getSeaLevel
public abstract int getSeaLevel() -
getMinY
public abstract int getMinY() -
getBaseHeight
public abstract int getBaseHeight(int p_223032_, int p_223033_, Heightmap.Types p_223034_, LevelHeightAccessor p_223035_, RandomState p_223036_) -
getBaseColumn
public abstract NoiseColumn getBaseColumn(int p_223028_, int p_223029_, LevelHeightAccessor p_223030_, RandomState p_223031_) -
getFirstFreeHeight
public int getFirstFreeHeight(int p_223222_, int p_223223_, Heightmap.Types p_223224_, LevelHeightAccessor p_223225_, RandomState p_223226_) -
getFirstOccupiedHeight
public int getFirstOccupiedHeight(int p_223236_, int p_223237_, Heightmap.Types p_223238_, LevelHeightAccessor p_223239_, RandomState p_223240_) -
ensureStructuresGenerated
-
getRingPositionsFor
@Nullable public List<ChunkPos> getRingPositionsFor(ConcentricRingsStructurePlacement p_223120_, RandomState p_223121_) -
getPlacementsForStructure
private List<StructurePlacement> getPlacementsForStructure(Holder<Structure> p_223139_, RandomState p_223140_) -
addDebugScreenInfo
public abstract void addDebugScreenInfo(List<String> p_223175_, RandomState p_223176_, BlockPos p_223177_) -
getBiomeGenerationSettings
Deprecated.
-