pub trait StructureGenerationContext {
Show 21 methods
// Required methods
fn seed(&self) -> i64;
fn chunk_x(&self) -> i32;
fn chunk_z(&self) -> i32;
fn chunk_min_x(&self) -> i32;
fn chunk_min_z(&self) -> i32;
fn center_block_x(&self) -> i32;
fn center_block_z(&self) -> i32;
fn sea_level(&self) -> i32;
fn min_y(&self) -> i32;
fn height(&self) -> i32;
fn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>;
fn templates(&self) -> &FxHashMap<Identifier, TemplateData>;
fn base_height(&mut self, x: i32, z: i32, ocean_floor: bool) -> i32;
fn base_height_full(&mut self, x: i32, z: i32, ocean_floor: bool) -> i32;
fn biome_at(&mut self, block_x: i32, block_y: i32, block_z: i32) -> BiomeRef;
fn column_state(&mut self, x: i32, y: i32, z: i32) -> ColumnBlock;
fn surface_y(&mut self) -> i32;
fn terrain_surface_height(&self, x: i32, z: i32, ocean_floor: bool) -> i32;
fn terrain_is_opaque(
&self,
x: i32,
y: i32,
z: i32,
ocean_floor: bool,
) -> bool;
// Provided methods
fn max_y(&self) -> i32 { ... }
fn solid_block_below_air(
&mut self,
x: i32,
z: i32,
start_y: i32,
min_solid_y: i32,
) -> Option<i32> { ... }
}Expand description
Terrain, biome, and template queries exposed to structure algorithms.
Vanilla calls these through ChunkGenerator/WorldGenLevel; keeping the
interface here lets structure algorithms stay independent of a concrete
chunk generator while preserving their vanilla query order.
Required Methods§
Sourcefn chunk_min_x(&self) -> i32
fn chunk_min_x(&self) -> i32
Minimum block X of the chunk.
Sourcefn chunk_min_z(&self) -> i32
fn chunk_min_z(&self) -> i32
Minimum block Z of the chunk.
Sourcefn center_block_x(&self) -> i32
fn center_block_x(&self) -> i32
Center block X of the chunk.
Sourcefn center_block_z(&self) -> i32
fn center_block_z(&self) -> i32
Center block Z of the chunk.
Sourcefn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>
fn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>
Template pool registry for jigsaw assembly.
Sourcefn templates(&self) -> &FxHashMap<Identifier, TemplateData>
fn templates(&self) -> &FxHashMap<Identifier, TemplateData>
Structure templates (piece definitions + sizes).
Sourcefn base_height_full(&mut self, x: i32, z: i32, ocean_floor: bool) -> i32
fn base_height_full(&mut self, x: i32, z: i32, ocean_floor: bool) -> i32
Full-column base height scan.
Sourcefn biome_at(&mut self, block_x: i32, block_y: i32, block_z: i32) -> BiomeRef
fn biome_at(&mut self, block_x: i32, block_y: i32, block_z: i32) -> BiomeRef
Biome at a block position.
Sourcefn column_state(&mut self, x: i32, y: i32, z: i32) -> ColumnBlock
fn column_state(&mut self, x: i32, y: i32, z: i32) -> ColumnBlock
Classify a block in the generator’s base terrain.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".