Trait GenerationContext
pub trait GenerationContext {
Show 13 methods
// Required methods
fn metadata(&self) -> &dyn BlockMetadata;
fn chunk(&self) -> ChunkPos;
fn seed(&self) -> i64;
fn sea_level(&self) -> i32;
fn min_y(&self) -> i32;
fn max_y(&self) -> i32;
fn random(&mut self) -> &mut dyn StructureRandom;
fn base_height(&mut self, x: i32, z: i32, kind: HeightmapType) -> i32;
fn base_columns(
&mut self,
x: i32,
z: i32,
kinds: &[HeightmapType],
) -> Vec<Vec<bool>>;
fn noise_column(&mut self, x: i32, z: i32) -> NoiseColumn;
fn noise_biome(&mut self, quart: [i32; 3]) -> BiomeId;
fn column_has_valid_biome(
&mut self,
x: i32,
z: i32,
min_y: i32,
max_y: i32,
) -> bool;
fn config(&self) -> Arc<Tag> ⓘ;
}Expand description
The start context a type’s
find_generation_point sees:
vanilla’s GenerationContext over one chunk, on the worker thread;
deterministic for the seed.
Required Methods§
fn metadata(&self) -> &dyn BlockMetadata
fn metadata(&self) -> &dyn BlockMetadata
Immutable, load-owned block metadata, safe to borrow on this worker.
fn random(&mut self) -> &mut dyn StructureRandom
fn random(&mut self) -> &mut dyn StructureRandom
The random vanilla’s types draw from, seeded for this chunk
(WorldgenRandom.setLargeFeatureSeed of the seed, chunk X and Z).
fn base_height(&mut self, x: i32, z: i32, kind: HeightmapType) -> i32
fn base_height(&mut self, x: i32, z: i32, kind: HeightmapType) -> i32
ChunkGenerator.getBaseHeight: the first free height at (x, z) by the
heightmap kind.
fn base_columns(
&mut self,
x: i32,
z: i32,
kinds: &[HeightmapType],
) -> Vec<Vec<bool>>
fn base_columns( &mut self, x: i32, z: i32, kinds: &[HeightmapType], ) -> Vec<Vec<bool>>
ChunkGenerator.getBaseColumn as heightmap opacity, from min_y up,
for several kinds from one noise-column pass.
fn noise_column(&mut self, x: i32, z: i32) -> NoiseColumn
fn noise_column(&mut self, x: i32, z: i32) -> NoiseColumn
ChunkGenerator.getBaseColumn’s blocks: the noise column at (x, z).
fn noise_biome(&mut self, quart: [i32; 3]) -> BiomeId
fn noise_biome(&mut self, quart: [i32; 3]) -> BiomeId
Noise biome at a quart position (the resolver’s, no zoom).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".