pub struct FlatChunkGenerator {
pub layers: Vec<BlockStateId>,
biome_id: u16,
seed: i64,
sea_level: i32,
structure_generator: Option<StructureGenerator>,
}Expand description
A chunk generator that generates a flat world.
Uses a fixed biome (plains) for all positions, matching vanilla’s
FlatLevelSource with FixedBiomeSource.
Fields§
§layers: Vec<BlockStateId>Block layers from world bottom upwards.
biome_id: u16The biome ID for plains (cached at construction).
seed: i64World seed for structure placement.
sea_level: i32Sea level for this flat generator’s dimension type.
structure_generator: Option<StructureGenerator>Optional structure engine from flat structure overrides.
Implementations§
Source§impl FlatChunkGenerator
impl FlatChunkGenerator
Sourcepub fn new(
bedrock: BlockStateId,
dirt: BlockStateId,
grass: BlockStateId,
) -> Self
pub fn new( bedrock: BlockStateId, dirt: BlockStateId, grass: BlockStateId, ) -> Self
Creates a new FlatChunkGenerator.
Sourcepub fn new_layers(layers: Vec<BlockStateId>) -> Self
pub fn new_layers(layers: Vec<BlockStateId>) -> Self
Creates a new flat generator with explicit block layers from bottom upwards.
Sourcepub(crate) fn new_layers_with_structures(
layers: Vec<BlockStateId>,
seed: i64,
sea_level: i32,
structure_generator: Option<StructureGenerator>,
) -> Self
pub(crate) fn new_layers_with_structures( layers: Vec<BlockStateId>, seed: i64, sea_level: i32, structure_generator: Option<StructureGenerator>, ) -> Self
Creates a flat generator with optional structure generation.
Trait Implementations§
Source§impl ChunkGenerator for FlatChunkGenerator
impl ChunkGenerator for FlatChunkGenerator
Source§fn noise_biome(&self, _quart_x: i32, _quart_y: i32, _quart_z: i32) -> BiomeRef
fn noise_biome(&self, _quart_x: i32, _quart_y: i32, _quart_z: i32) -> BiomeRef
Returns the generator biome at one quart position without requiring a loaded chunk.
Source§fn spawn_height(&self, min_y: i32, height: i32) -> i32
fn spawn_height(&self, min_y: i32, height: i32) -> i32
Returns the generator-provided spawn height used before falling back to the surface heightmap.
Source§fn structure_generator(&self) -> Option<&StructureGenerator>
fn structure_generator(&self) -> Option<&StructureGenerator>
Returns the structure generator used for placement and locate queries.
Source§fn create_structures(&self, chunk: &Chunk)
fn create_structures(&self, chunk: &Chunk)
Creates the structures in a chunk.
Source§fn create_biomes(&self, chunk: &Chunk)
fn create_biomes(&self, chunk: &Chunk)
Creates the biomes in a chunk.
Source§fn fill_from_noise(
&self,
chunk: GenerationChunk<'_, NoisePhase>,
_beardifier: Option<&Beardifier>,
)
fn fill_from_noise( &self, chunk: GenerationChunk<'_, NoisePhase>, _beardifier: Option<&Beardifier>, )
Fills the chunk with noise. Read more
Source§fn build_surface(
&self,
_chunk: GenerationChunk<'_, SurfacePhase>,
_neighbor_biomes: &dyn Fn(IVec3) -> u16,
)
fn build_surface( &self, _chunk: GenerationChunk<'_, SurfacePhase>, _neighbor_biomes: &dyn Fn(IVec3) -> u16, )
Builds the surface of the chunk. Read more
Source§fn apply_carvers(&self, _chunk: GenerationChunk<'_, CarversPhase>)
fn apply_carvers(&self, _chunk: GenerationChunk<'_, CarversPhase>)
Applies carvers to the chunk.
Source§fn create_worldgen_region_random(
&self,
world_seed: i64,
center: ChunkPos,
) -> RandomSource
fn create_worldgen_region_random( &self, world_seed: i64, center: ChunkPos, ) -> RandomSource
Creates the per-region random source exposed by vanilla
WorldGenRegion.getRandom().Source§fn apply_biome_decorations(&self, _region: &mut WorldGenRegion<'_>)
fn apply_biome_decorations(&self, _region: &mut WorldGenRegion<'_>)
Applies structure piece placement and biome feature decorations.
Source§fn initial_spawn_search_origin(&self) -> BlockPos
fn initial_spawn_search_origin(&self) -> BlockPos
Returns the climate-selected origin used by vanilla before searching for a safe spawn chunk.
Source§impl From<FlatChunkGenerator> for ChunkGeneratorType
impl From<FlatChunkGenerator> for ChunkGeneratorType
Source§fn from(v: FlatChunkGenerator) -> ChunkGeneratorType
fn from(v: FlatChunkGenerator) -> ChunkGeneratorType
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for FlatChunkGenerator
impl !UnwindSafe for FlatChunkGenerator
impl Freeze for FlatChunkGenerator
impl Send for FlatChunkGenerator
impl Sync for FlatChunkGenerator
impl Unpin for FlatChunkGenerator
impl UnsafeUnpin for FlatChunkGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>