Skip to main content

StructureGenerationContext

Trait StructureGenerationContext 

Source
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§

Source

fn seed(&self) -> i64

World seed.

Source

fn chunk_x(&self) -> i32

Chunk X being populated.

Source

fn chunk_z(&self) -> i32

Chunk Z being populated.

Source

fn chunk_min_x(&self) -> i32

Minimum block X of the chunk.

Source

fn chunk_min_z(&self) -> i32

Minimum block Z of the chunk.

Source

fn center_block_x(&self) -> i32

Center block X of the chunk.

Source

fn center_block_z(&self) -> i32

Center block Z of the chunk.

Source

fn sea_level(&self) -> i32

Sea level for this generator/dimension.

Source

fn min_y(&self) -> i32

Minimum build Y.

Source

fn height(&self) -> i32

Total build height.

Source

fn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>

Template pool registry for jigsaw assembly.

Source

fn templates(&self) -> &FxHashMap<Identifier, TemplateData>

Structure templates (piece definitions + sizes).

Source

fn base_height(&mut self, x: i32, z: i32, ocean_floor: bool) -> i32

Base height at a column.

Source

fn base_height_full(&mut self, x: i32, z: i32, ocean_floor: bool) -> i32

Full-column base height scan.

Source

fn biome_at(&mut self, block_x: i32, block_y: i32, block_z: i32) -> BiomeRef

Biome at a block position.

Source

fn column_state(&mut self, x: i32, y: i32, z: i32) -> ColumnBlock

Classify a block in the generator’s base terrain.

Source

fn surface_y(&mut self) -> i32

Chunk-center surface Y, memoised by the concrete context.

Source

fn terrain_surface_height(&self, x: i32, z: i32, ocean_floor: bool) -> i32

Surface height for off-chunk terrain queries used by piece placement.

Source

fn terrain_is_opaque(&self, x: i32, y: i32, z: i32, ocean_floor: bool) -> bool

Opaque terrain test for off-chunk terrain queries used by piece placement.

Provided Methods§

Source

fn max_y(&self) -> i32

One-past-maximum build Y.

Source

fn solid_block_below_air( &mut self, x: i32, z: i32, start_y: i32, min_solid_y: i32, ) -> Option<i32>

Highest solid base-terrain block directly below air in [min_solid_y, start_y).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§