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;
}
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more