public abstract class ChunkSource
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<BlockSource> |
blockSources |
protected static int |
DEEP_OCEAN_MIN_DEPTH |
protected net.minecraft.block.state.IBlockState |
defaultBlock |
protected net.minecraft.block.state.IBlockState |
defaultFluid |
protected static int |
OCEAN_MIN_DEPTH |
protected java.util.Random |
random |
protected int |
seaLevel |
protected long |
seed |
protected ModernBetaGeneratorSettings |
settings |
protected int |
worldHeight |
| Constructor and Description |
|---|
ChunkSource(long seed,
ModernBetaGeneratorSettings settings)
Constructs an abstract ChunkSource to hold basic underlying terrain generation information.
|
| Modifier and Type | Method and Description |
|---|---|
BiomeInjectionRules |
buildBiomeInjectorRules(BiomeSource biomeSource)
Deprecated.
|
BiomeInjectionRules.Builder |
createBiomeInjectionRules(BiomeSource biomeSource)
Creates the rule set builder used for biome injection.
|
protected java.util.Random |
createRandom(long seed)
Creates a new Random for world generation.
|
java.util.Optional<PerlinOctaveNoise> |
getBeachOctaveNoise()
Gets the PerlinOctaveNoise sampler used for beach generation.
|
net.minecraft.block.state.IBlockState |
getDefaultBlock()
Gets the default block for the chunk source, usually stone.
|
net.minecraft.block.state.IBlockState |
getDefaultFluid()
Gets the default fluid for the chunk source, either water or lava.
|
java.util.Optional<PerlinOctaveNoise> |
getForestOctaveNoise()
Gets the PerlinOctaveNoise sampler used for tree placement.
|
ModernBetaGeneratorSettings |
getGeneratorSettings()
Gets the chunk generator settings.
|
abstract int |
getHeight(int x,
int z,
HeightmapChunk.Type type)
Sample height at given x/z coordinate.
|
int |
getSeaLevel()
Gets the chunk source sea level set in the chunk generator settings.
|
long |
getSeed()
Gets the world seed.
|
java.util.Optional<PerlinOctaveNoise> |
getSurfaceOctaveNoise()
Gets the PerlinOctaveNoise sampler used for surface generation.
|
WorldSpawner |
getWorldSpawner()
Gets the world spawner used to initially place the player spawn.
|
abstract void |
provideInitialChunk(net.minecraft.world.chunk.ChunkPrimer chunkPrimer,
int chunkX,
int chunkZ)
Create initial chunk given chunk coordinates.
|
abstract void |
provideProcessedChunk(net.minecraft.world.chunk.ChunkPrimer chunkPrimer,
int chunkX,
int chunkZ,
java.util.List<net.minecraft.world.gen.structure.StructureComponent> structureComponents)
Create processed chunk given chunk coordinates.
|
abstract void |
provideSurface(net.minecraft.world.World world,
net.minecraft.world.biome.Biome[] biomes,
net.minecraft.world.chunk.ChunkPrimer chunkPrimer,
int chunkX,
int chunkZ)
Build surface for given chunk primer and chunk coordinates.
|
void |
pruneChunk(net.minecraft.world.World world,
int chunkX,
int chunkZ)
Prunes the chuck at the given coordinates.
|
protected void |
setBeachOctaveNoise(PerlinOctaveNoise beachOctaveNoise)
Sets the default PerlinOctaveNoise sampler used for beach generation for the default surface generator in
ModernBetaBiome. |
protected void |
setCloudHeight(int cloudHeight)
Sets the cloud height in the
ModernBetaWorldType world type. |
protected void |
setForestOctaveNoise(PerlinOctaveNoise forestOctaveNoise)
Sets the PerlinOctaveNoise sampler used for tree placement.
|
protected void |
setSurfaceOctaveNoise(PerlinOctaveNoise surfaceOctaveNoise)
Sets the PerlinOctaveNoise sampler used for surface generation.
|
boolean |
skipChunk(int chunkX,
int chunkZ)
Indicate whether the chunk at the given coordinates should be skipped.
|
protected static final int OCEAN_MIN_DEPTH
protected static final int DEEP_OCEAN_MIN_DEPTH
protected final long seed
protected final ModernBetaGeneratorSettings settings
protected final java.util.Random random
protected final net.minecraft.block.state.IBlockState defaultBlock
protected final net.minecraft.block.state.IBlockState defaultFluid
protected final int worldHeight
protected final int seaLevel
protected final java.util.List<BlockSource> blockSources
public ChunkSource(long seed,
ModernBetaGeneratorSettings settings)
seed - The world seed.settings - The generator settings.public abstract void provideInitialChunk(net.minecraft.world.chunk.ChunkPrimer chunkPrimer,
int chunkX,
int chunkZ)
BiomeProvider.getBiome() from World.
At this stage, the biomes have not actually been set for ModernBetaBiome to sample from.
Instead, get the biome provider, cast to ModernBetaBiomeProvider and use ModernBetaBiomeProvider.getBiomeSource() to sample biomes, or do final generation in processedChunk to get processed biome map.chunkPrimer - Chunk primerchunkX - x-coordinate in chunk coordinateschunkZ - z-coordinate in chunk coordinatespublic abstract void provideProcessedChunk(net.minecraft.world.chunk.ChunkPrimer chunkPrimer,
int chunkX,
int chunkZ,
java.util.List<net.minecraft.world.gen.structure.StructureComponent> structureComponents)
provideInitialChunk so villages can be placed correctly.
This does not need to be implemented and can be left empty, if you don't wish to do additional processing.chunkPrimer - Chunk primerchunkX - x-coordinate in chunk coordinateschunkZ - z-coordinate in chunk coordinatesstructureComponents - The list of structure components that at least partially occupy this chunk.public abstract void provideSurface(net.minecraft.world.World world,
net.minecraft.world.biome.Biome[] biomes,
net.minecraft.world.chunk.ChunkPrimer chunkPrimer,
int chunkX,
int chunkZ)
world - The world objectbiomes - Biome array for chunkchunkPrimer - Chunk primerchunkX - x-coordinate in chunk coordinateschunkZ - z-coordinate in chunk coordinatespublic abstract int getHeight(int x,
int z,
HeightmapChunk.Type type)
x - x-coordinate in block coordinates.z - z-coordinate in block coordinates.type - HeightmapChunk.Type.public int getSeaLevel()
public net.minecraft.block.state.IBlockState getDefaultBlock()
public net.minecraft.block.state.IBlockState getDefaultFluid()
public ModernBetaGeneratorSettings getGeneratorSettings()
ModernBetaGeneratorSettings settings.public WorldSpawner getWorldSpawner()
WorldSpawner.DEFAULT by default.public java.util.Optional<PerlinOctaveNoise> getBeachOctaveNoise()
public java.util.Optional<PerlinOctaveNoise> getSurfaceOctaveNoise()
public java.util.Optional<PerlinOctaveNoise> getForestOctaveNoise()
public long getSeed()
public boolean skipChunk(int chunkX,
int chunkZ)
FiniteChunkSource.chunkX - x-coordinate in chunk coordinateschunkZ - z-coordinate in chunk coordinatespublic void pruneChunk(net.minecraft.world.World world,
int chunkX,
int chunkZ)
FiniteChunkSource.world - The world objectchunkX - x-coordinate in chunk coordinateschunkZ - z-coordinate in chunk coordinates@Deprecated public BiomeInjectionRules buildBiomeInjectorRules(BiomeSource biomeSource)
createBiomeInjectionRules instead.biomeSource - The biome source.public BiomeInjectionRules.Builder createBiomeInjectionRules(BiomeSource biomeSource)
biomeSource - The biome source.protected java.util.Random createRandom(long seed)
seed - The world seedprotected void setCloudHeight(int cloudHeight)
ModernBetaWorldType world type.cloudHeight - y-coordinate of the new cloud height, in block coordinates.protected void setBeachOctaveNoise(PerlinOctaveNoise beachOctaveNoise)
ModernBetaBiome.beachOctaveNoise - The noise sampler, may be null.protected void setSurfaceOctaveNoise(PerlinOctaveNoise surfaceOctaveNoise)
surfaceOctaveNoise - The noise sampler, may be null.protected void setForestOctaveNoise(PerlinOctaveNoise forestOctaveNoise)
forestOctaveNoise - The noise sampler, may be null.