Skip to main content

StructureBiomeProvider

Trait StructureBiomeProvider 

Source
pub trait StructureBiomeProvider {
    // Required methods
    fn possible_biomes(&self) -> FxHashSet<Identifier>;
    fn find_biome_horizontal(
        &self,
        origin_x: i32,
        origin_z: i32,
        search_radius: i32,
        allowed: &dyn Fn(&Identifier) -> bool,
        rng: &mut LegacyRandom,
    ) -> Option<(i32, i32)>;

    // Provided method
    fn ring_position_cache_key(&self) -> Option<String> { ... }
}
Expand description

Biome operations needed while building ChunkGeneratorStructureState.

Required Methods§

Source

fn possible_biomes(&self) -> FxHashSet<Identifier>

Every biome this provider can produce.

Source

fn find_biome_horizontal( &self, origin_x: i32, origin_z: i32, search_radius: i32, allowed: &dyn Fn(&Identifier) -> bool, rng: &mut LegacyRandom, ) -> Option<(i32, i32)>

Vanilla’s BiomeSource.findBiomeHorizontal(findClosest=false, skipSteps=1).

Provided Methods§

Source

fn ring_position_cache_key(&self) -> Option<String>

Stable identity for every provider input that can affect ring snapping.

Providers without a stable identity are not eligible for ring-position persistence and should keep the default None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§