Trait fastanvil::Chunk

source ·
pub trait Chunk: Send + Sync {
    // Required methods
    fn status(&self) -> String;
    fn surface_height(&self, x: usize, z: usize, mode: HeightMode) -> isize;
    fn biome(&self, x: usize, y: isize, z: usize) -> Option<Biome>;
    fn block(&self, x: usize, y: isize, z: usize) -> Option<&Block>;
    fn y_range(&self) -> Range<isize>;
}

Required Methods§

source

fn status(&self) -> String

source

fn surface_height(&self, x: usize, z: usize, mode: HeightMode) -> isize

Get the height of the first air-like block above something not air-like. Will panic if given x/z coordinates outside of 0..16.

source

fn biome(&self, x: usize, y: isize, z: usize) -> Option<Biome>

Get the biome of the given coordinate. A biome may not exist if the section of the chunk accessed is not present. For example, trying to access the block at height 1234 would return None.

source

fn block(&self, x: usize, y: isize, z: usize) -> Option<&Block>

Get the block at the given coordinates. A block may not exist if the section of the chunk accessed is not present. For example, trying to access the block at height 1234 would return None.

source

fn y_range(&self) -> Range<isize>

Get the range of Y values that are valid for this chunk.

Implementors§

source§

impl Chunk for fastanvil::JavaChunk

source§

impl Chunk for Chunk

source§

impl Chunk for fastanvil::pre13::JavaChunk

source§

impl Chunk for fastanvil::pre18::JavaChunk

source§

impl Chunk for CurrentJavaChunk