Class ChunkGenerator
java.lang.Object
net.minecraft.world.level.chunk.ChunkGenerator
- Direct Known Subclasses:
DebugLevelSource, FlatLevelSource, NoiseBasedChunkGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BiomeSourcestatic final com.mojang.serialization.Codec<ChunkGenerator> private final Supplier<List<FeatureSorter.StepFeatureData>> private final Function<Holder<Biome>, BiomeGenerationSettings> -
Constructor Summary
ConstructorsConstructorDescriptionChunkGenerator(BiomeSource biomeSource) ChunkGenerator(BiomeSource biomeSource, Function<Holder<Biome>, BiomeGenerationSettings> generationSettingsGetter) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddDebugScreenInfo(List<String> result, RandomState randomState, BlockPos feetPos) voidapplyBiomeDecoration(WorldGenLevel level, ChunkAccess chunk, StructureManager structureManager) abstract voidapplyCarvers(WorldGenRegion region, long seed, RandomState randomState, BiomeManager biomeManager, StructureManager structureManager, ChunkAccess chunk) abstract voidbuildSurface(WorldGenRegion level, StructureManager structureManager, RandomState randomState, ChunkAccess protoChunk) protected abstract com.mojang.serialization.MapCodec<? extends ChunkGenerator> codec()createBiomes(RandomState randomState, Blender blender, StructureManager structureManager, ChunkAccess protoChunk) voidcreateReferences(WorldGenLevel level, StructureManager structureManager, ChunkAccess centerChunk) createState(HolderLookup<StructureSet> structureSets, RandomState randomState, long legacyLevelSeed) voidcreateStructures(RegistryAccess registryAccess, ChunkGeneratorStructureState state, StructureManager structureManager, ChunkAccess centerChunk, StructureTemplateManager structureTemplateManager, ResourceKey<Level> level) private static intfetchReferences(StructureManager structureManager, ChunkAccess centerChunk, SectionPos sectionPos, Structure structure) abstract CompletableFuture<ChunkAccess> fillFromNoise(Blender blender, RandomState randomState, StructureManager structureManager, ChunkAccess centerChunk) findNearestMapStructure(ServerLevel level, HolderSet<Structure> wantedStructures, BlockPos pos, int maxSearchRadius, boolean createReference) abstract NoiseColumngetBaseColumn(int x, int z, LevelHeightAccessor heightAccessor, RandomState randomState) abstract intgetBaseHeight(int x, int z, Heightmap.Types type, LevelHeightAccessor heightAccessor, RandomState randomState) getBiomeGenerationSettings(Holder<Biome> biome) Deprecated.intgetFirstFreeHeight(int x, int z, Heightmap.Types type, LevelHeightAccessor heightAccessor, RandomState randomState) intgetFirstOccupiedHeight(int x, int z, Heightmap.Types type, LevelHeightAccessor heightAccessor, RandomState randomState) abstract intabstract intgetMinY()getMobsAt(Holder<Biome> biome, StructureManager structureManager, MobCategory mobCategory, BlockPos pos) getNearestGeneratedStructure(Set<Holder<Structure>> structures, ServerLevel level, StructureManager structureManager, BlockPos pos, boolean createReference, ConcentricRingsStructurePlacement rings) getNearestGeneratedStructure(Set<Holder<Structure>> structures, LevelReader level, StructureManager structureManager, int chunkOriginX, int chunkOriginZ, int radius, boolean createReference, long seed, RandomSpreadStructurePlacement config) abstract intintgetSpawnHeight(LevelHeightAccessor heightAccessor) getStructureGeneratingAt(Set<Holder<Structure>> structures, LevelReader level, StructureManager structureManager, boolean createReference, StructurePlacement config, ChunkPos chunkTarget) private static BoundingBoxgetWritableArea(ChunkAccess chunk) voidabstract voidspawnOriginalMobs(WorldGenRegion worldGenRegion) private static booleantryAddReference(StructureManager manager, StructureStart start) private booleantryGenerateStructure(StructureSet.StructureSelectionEntry selected, StructureManager structureManager, RegistryAccess registryAccess, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkAccess centerChunk, ChunkPos sourceChunkPos, SectionPos sectionPos, ResourceKey<Level> level) voidvalidate()
-
Field Details
-
CODEC
-
biomeSource
-
featuresPerStep
-
generationSettingsGetter
-
-
Constructor Details
-
ChunkGenerator
-
ChunkGenerator
public ChunkGenerator(BiomeSource biomeSource, Function<Holder<Biome>, BiomeGenerationSettings> generationSettingsGetter)
-
-
Method Details
-
refreshFeaturesPerStep
@Internal public void refreshFeaturesPerStep() -
validate
public void validate() -
codec
-
createState
public ChunkGeneratorStructureState createState(HolderLookup<StructureSet> structureSets, RandomState randomState, long legacyLevelSeed) -
getTypeNameForDataFixer
-
createBiomes
public CompletableFuture<ChunkAccess> createBiomes(RandomState randomState, Blender blender, StructureManager structureManager, ChunkAccess protoChunk) -
applyCarvers
public abstract void applyCarvers(WorldGenRegion region, long seed, RandomState randomState, BiomeManager biomeManager, StructureManager structureManager, ChunkAccess chunk) -
findNearestMapStructure
-
getNearestGeneratedStructure
private @Nullable com.mojang.datafixers.util.Pair<BlockPos, Holder<Structure>> getNearestGeneratedStructure(Set<Holder<Structure>> structures, ServerLevel level, StructureManager structureManager, BlockPos pos, boolean createReference, ConcentricRingsStructurePlacement rings) -
getNearestGeneratedStructure
private static @Nullable com.mojang.datafixers.util.Pair<BlockPos, Holder<Structure>> getNearestGeneratedStructure(Set<Holder<Structure>> structures, LevelReader level, StructureManager structureManager, int chunkOriginX, int chunkOriginZ, int radius, boolean createReference, long seed, RandomSpreadStructurePlacement config) -
getStructureGeneratingAt
private static @Nullable com.mojang.datafixers.util.Pair<BlockPos, Holder<Structure>> getStructureGeneratingAt(Set<Holder<Structure>> structures, LevelReader level, StructureManager structureManager, boolean createReference, StructurePlacement config, ChunkPos chunkTarget) -
tryAddReference
-
applyBiomeDecoration
public void applyBiomeDecoration(WorldGenLevel level, ChunkAccess chunk, StructureManager structureManager) -
getWritableArea
-
buildSurface
public abstract void buildSurface(WorldGenRegion level, StructureManager structureManager, RandomState randomState, ChunkAccess protoChunk) -
spawnOriginalMobs
-
getSpawnHeight
-
getBiomeSource
-
getGenDepth
public abstract int getGenDepth() -
getMobsAt
public WeightedList<MobSpawnSettings.SpawnerData> getMobsAt(Holder<Biome> biome, StructureManager structureManager, MobCategory mobCategory, BlockPos pos) -
createStructures
public void createStructures(RegistryAccess registryAccess, ChunkGeneratorStructureState state, StructureManager structureManager, ChunkAccess centerChunk, StructureTemplateManager structureTemplateManager, ResourceKey<Level> level) -
tryGenerateStructure
private boolean tryGenerateStructure(StructureSet.StructureSelectionEntry selected, StructureManager structureManager, RegistryAccess registryAccess, RandomState randomState, StructureTemplateManager structureTemplateManager, long seed, ChunkAccess centerChunk, ChunkPos sourceChunkPos, SectionPos sectionPos, ResourceKey<Level> level) -
fetchReferences
private static int fetchReferences(StructureManager structureManager, ChunkAccess centerChunk, SectionPos sectionPos, Structure structure) -
createReferences
public void createReferences(WorldGenLevel level, StructureManager structureManager, ChunkAccess centerChunk) -
fillFromNoise
public abstract CompletableFuture<ChunkAccess> fillFromNoise(Blender blender, RandomState randomState, StructureManager structureManager, ChunkAccess centerChunk) -
getSeaLevel
public abstract int getSeaLevel() -
getMinY
public abstract int getMinY() -
getBaseHeight
public abstract int getBaseHeight(int x, int z, Heightmap.Types type, LevelHeightAccessor heightAccessor, RandomState randomState) -
getBaseColumn
public abstract NoiseColumn getBaseColumn(int x, int z, LevelHeightAccessor heightAccessor, RandomState randomState) -
getFirstFreeHeight
public int getFirstFreeHeight(int x, int z, Heightmap.Types type, LevelHeightAccessor heightAccessor, RandomState randomState) -
getFirstOccupiedHeight
public int getFirstOccupiedHeight(int x, int z, Heightmap.Types type, LevelHeightAccessor heightAccessor, RandomState randomState) -
addDebugScreenInfo
public abstract void addDebugScreenInfo(List<String> result, RandomState randomState, BlockPos feetPos) -
getBiomeGenerationSettings
Deprecated.
-