pub struct Pre18Blockstates { /* private fields */ }Implementations§
Source§impl Pre18Blockstates
impl Pre18Blockstates
Sourcepub fn state(&self, x: usize, sec_y: usize, z: usize, pal_len: usize) -> usize
pub fn state(&self, x: usize, sec_y: usize, z: usize, pal_len: usize) -> usize
Get the state for the given block at x,y,z, where x, y, and z are relative to the section ie 0..16
Sourcepub fn iter_indices(&self, pal_len: usize) -> impl Iterator<Item = usize> + '_
pub fn iter_indices(&self, pal_len: usize) -> impl Iterator<Item = usize> + '_
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.
The pal_len must be the length of the palette corresponding to these blockstates.
You can recover the coordinate be enumerating the iterator:
for (i, block_index) in states.iter_indices(10).enumerate() {
let x = i & 0x000F;
let y = (i & 0x0F00) >> 8;
let z = (i & 0x00F0) >> 4;
}Trait Implementations§
Source§impl Debug for Pre18Blockstates
impl Debug for Pre18Blockstates
Source§impl<'de> Deserialize<'de> for Pre18Blockstates
impl<'de> Deserialize<'de> for Pre18Blockstates
Source§fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for Pre18Blockstates
impl RefUnwindSafe for Pre18Blockstates
impl Send for Pre18Blockstates
impl Sync for Pre18Blockstates
impl Unpin for Pre18Blockstates
impl UnwindSafe for Pre18Blockstates
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more