Skip to main content

BiomeColorResolver

Trait BiomeColorResolver 

pub trait BiomeColorResolver:
    Send
    + Sync
    + 'static {
    // Required method
    fn color(&self, biome: &str, info: &ResolverBiome, x: f64, z: f64) -> u32;
}
Expand description

A mod’s colour resolver: vanilla’s ColorResolver, which the game blends over the biomes around a block as it blends its own (ClientLevel.calculateBlockTint, over the biome blend radius) and caches per section while it meshes. Held by the game and asked on the meshing workers, so it keeps no mutable state and gets no Host.

Required Methods§

fn color(&self, biome: &str, info: &ResolverBiome, x: f64, z: f64) -> u32

getColor(biome, x, z): the colour of biome (minecraft:plains) at block column (x, z), 0xRRGGBB.

Trait Implementations§

§

impl Wire for Box<dyn BiomeColorResolver>

§

const MIN: usize = 8

Minimum encoded size, used to reject impossible collection lengths.
§

fn put(&self, out: &mut Writer)

Encodes this value, recording failures on the writer.
§

fn put_owned(self, out: &mut Writer)

Consumes owned data when a resource’s ownership must cross the boundary.
§

fn take( input: &mut Reader<'_>, ) -> Result<Box<dyn BiomeColorResolver>, WireError>

Decodes one value, leaving any following bytes for the caller.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§