Struct fastanvil::BlockData[][src]

pub struct BlockData<T: Debug> { /* fields omitted */ }

Implementations

Get the block data for the block at x,y,z, where x,y,z are relative to the section ie 0..16.

Get iterator for the state indicies. This will increase in x, then z, then y. These indicies are used with the relevant palette to get the data for that block.

This returns None if no block states were present. This typically means the section was empty (ie filled with air).

You can recover the coordinate be enumerating the iterator:

for (i, block_index) in states.try_iter_indices().unwrap().enumerate() {
    let x = i & 0x000F;
    let y = (i & 0x0F00) >> 8;
    let z = (i & 0x00F0) >> 4;
}

Get the palette for this block data. Indicies into this palette can be obtained via try_iter_indices.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.