Package net.minecraft.world.gen.chunk
Class NoiseChunkGenerator
java.lang.Object
net.minecraft.world.gen.chunk.ChunkGenerator
net.minecraft.world.gen.chunk.NoiseChunkGenerator
public final class NoiseChunkGenerator extends ChunkGenerator
-
Field Summary
Fields Modifier and Type Field Description private static BlockStateAIRprivate static float[]BIOME_WEIGHT_TABLEstatic com.mojang.serialization.Codec<NoiseChunkGenerator>CODECprotected BlockStatedefaultBlockprotected BlockStatedefaultFluidprivate OctavePerlinNoiseSamplerdensityNoiseprivate inthorizontalNoiseResolutionprivate OctavePerlinNoiseSamplerinterpolationNoiseprivate SimplexNoiseSamplerislandNoiseprivate OctavePerlinNoiseSamplerlowerInterpolatedNoiseprivate static float[]NOISE_WEIGHT_TABLEprivate intnoiseSizeXprivate intnoiseSizeYprivate intnoiseSizeZprotected ChunkRandomrandomprivate longseedprotected Supplier<ChunkGeneratorSettings>settingsprivate NoiseSamplersurfaceDepthNoiseprivate OctavePerlinNoiseSamplerupperInterpolatedNoiseprivate intverticalNoiseResolutionprivate intworldHeightFields inherited from class net.minecraft.world.gen.chunk.ChunkGenerator
biomeSource, populationSource -
Constructor Summary
Constructors Modifier Constructor Description NoiseChunkGenerator(BiomeSource biomeSource, long seed, Supplier<ChunkGeneratorSettings> settings)privateNoiseChunkGenerator(BiomeSource populationSource, BiomeSource biomeSource, long seed, Supplier<ChunkGeneratorSettings> settings) -
Method Summary
Modifier and Type Method Description private voidbuildBedrock(Chunk chunk, Random random)voidbuildSurface(ChunkRegion region, Chunk chunk)private static doublecalculateNoiseWeight(int x, int y, int z)protected BlockStategetBlockState(double density, int y)protected com.mojang.serialization.Codec<? extends ChunkGenerator>getCodec()VerticalBlockSamplegetColumnSample(int x, int z)List<SpawnSettings.SpawnEntry>getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)intgetHeight(int x, int z, Heightmap.Type heightmapType)private static doublegetNoiseWeight(int x, int y, int z)private doublegetRandomDensityAt(int x, int z)intgetSeaLevel()intgetWorldHeight()booleanmatchesSettings(long seed, RegistryKey<ChunkGeneratorSettings> settingsKey)voidpopulateEntities(ChunkRegion region)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 intsampleHeightmap(int x, int z, BlockState[] states, Predicate<BlockState> predicate)private doublesampleNoise(int x, int y, int z, double horizontalScale, double verticalScale, double horizontalStretch, double verticalStretch)private voidsampleNoiseColumn(double[] buffer, int x, int z)private double[]sampleNoiseColumn(int x, int z)ChunkGeneratorwithSeed(long seed)Methods inherited from class net.minecraft.world.gen.chunk.ChunkGenerator
addStructureReferences, carve, generateFeatures, getBiomeSource, getHeightInGround, getHeightOnGround, getSpawnHeight, getStructuresConfig, isStrongholdStartingChunk, locateStructure, populateBiomes, setStructureStarts
-
Field Details
-
CODEC
-
NOISE_WEIGHT_TABLE
private static final float[] NOISE_WEIGHT_TABLE -
BIOME_WEIGHT_TABLE
private static final float[] BIOME_WEIGHT_TABLE -
AIR
-
verticalNoiseResolution
private final int verticalNoiseResolution -
horizontalNoiseResolution
private final int horizontalNoiseResolution -
noiseSizeX
private final int noiseSizeX -
noiseSizeY
private final int noiseSizeY -
noiseSizeZ
private final int noiseSizeZ -
random
-
lowerInterpolatedNoise
-
upperInterpolatedNoise
-
interpolationNoise
-
surfaceDepthNoise
-
densityNoise
-
islandNoise
-
defaultBlock
-
defaultFluid
-
seed
private final long seed -
settings
-
worldHeight
private final int worldHeight
-
-
Constructor Details
-
NoiseChunkGenerator
public NoiseChunkGenerator(BiomeSource biomeSource, long seed, Supplier<ChunkGeneratorSettings> settings) -
NoiseChunkGenerator
private NoiseChunkGenerator(BiomeSource populationSource, BiomeSource biomeSource, long seed, Supplier<ChunkGeneratorSettings> settings)
-
-
Method Details
-
getCodec
- Specified by:
getCodecin classChunkGenerator
-
withSeed
- Specified by:
withSeedin classChunkGenerator
-
matchesSettings
-
sampleNoise
private double sampleNoise(int x, int y, int z, double horizontalScale, double verticalScale, double horizontalStretch, double verticalStretch) -
sampleNoiseColumn
private double[] sampleNoiseColumn(int x, int z) -
sampleNoiseColumn
private void sampleNoiseColumn(double[] buffer, int x, int z) -
getRandomDensityAt
private double getRandomDensityAt(int x, int z) -
getHeight
- Specified by:
getHeightin classChunkGenerator
-
getColumnSample
- Specified by:
getColumnSamplein classChunkGenerator
-
sampleHeightmap
private int sampleHeightmap(int x, int z, @Nullable BlockState[] states, @Nullable Predicate<BlockState> predicate) -
getBlockState
-
buildSurface
- Specified by:
buildSurfacein classChunkGenerator
-
buildBedrock
-
populateNoise
Generates the base shape of the chunk out of the basic block states as decided by this chunk generator's config.- Specified by:
populateNoisein classChunkGenerator
-
getNoiseWeight
private static double getNoiseWeight(int x, int y, int z) -
calculateNoiseWeight
private static double calculateNoiseWeight(int x, int y, int z) -
getWorldHeight
public int getWorldHeight()- Overrides:
getWorldHeightin classChunkGenerator
-
getSeaLevel
public int getSeaLevel()- Overrides:
getSeaLevelin classChunkGenerator
-
getEntitySpawnList
public List<SpawnSettings.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)- Overrides:
getEntitySpawnListin classChunkGenerator
-
populateEntities
- Overrides:
populateEntitiesin classChunkGenerator
-