pub trait SurfaceNoiseProvider {
// Required methods
fn condition_noise(&self, noise_index: usize, x: i32, z: i32) -> f64;
fn condition_noise_3d(
&self,
noise_index: usize,
x: i32,
y: i32,
z: i32,
) -> f64;
fn get_band(&self, x: i32, y: i32, z: i32) -> BlockStateId;
fn cold_enough_to_snow(
&self,
biome_id: u16,
block_x: i32,
block_y: i32,
block_z: i32,
) -> bool;
fn vertical_gradient(
&self,
gradient_index: usize,
block_x: i32,
block_y: i32,
block_z: i32,
true_at_and_below: i32,
false_at_and_above: i32,
) -> bool;
}Expand description
Trait for providing noise values and clay band data to surface rules.
Implemented by SurfaceSystem in steel-core. The transpiled code calls these
methods through the SurfaceRuleContext.system field.
Required Methods§
Sourcefn condition_noise(&self, noise_index: usize, x: i32, z: i32) -> f64
fn condition_noise(&self, noise_index: usize, x: i32, z: i32) -> f64
Sample a surface condition noise at (x, z). The noise is identified by
its index in the dimension’s surface_noise_ids() list.
Sourcefn condition_noise_3d(&self, noise_index: usize, x: i32, y: i32, z: i32) -> f64
fn condition_noise_3d(&self, noise_index: usize, x: i32, y: i32, z: i32) -> f64
Sample a surface condition noise at (x, y, z). The noise is identified by
its index in the dimension’s surface_noise_ids() list.
Sourcefn get_band(&self, x: i32, y: i32, z: i32) -> BlockStateId
fn get_band(&self, x: i32, y: i32, z: i32) -> BlockStateId
Get the badlands clay band block at position (x, y, z).
Sourcefn cold_enough_to_snow(
&self,
biome_id: u16,
block_x: i32,
block_y: i32,
block_z: i32,
) -> bool
fn cold_enough_to_snow( &self, biome_id: u16, block_x: i32, block_y: i32, block_z: i32, ) -> bool
Evaluates whether the biome temperature is cold enough for snow.
Sourcefn vertical_gradient(
&self,
gradient_index: usize,
block_x: i32,
block_y: i32,
block_z: i32,
true_at_and_below: i32,
false_at_and_above: i32,
) -> bool
fn vertical_gradient( &self, gradient_index: usize, block_x: i32, block_y: i32, block_z: i32, true_at_and_below: i32, false_at_and_above: i32, ) -> bool
Evaluate a vertical gradient condition using positional random.
Returns true if the random value at (block_x, block_y, block_z) falls
within the gradient between true_at_and_below and false_at_and_above.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".