pub struct ParsedChunk { /* private fields */ }
Expand description
A parsed chunk, which owns its NBT data
The full NBT structure can be accessed through the Deref
implementation to nbt::ChunkNbt
Implementations§
Source§impl ParsedChunk
impl ParsedChunk
Sourcepub fn get_chunk_section_at(&self, block_y: i32) -> Option<&ChunkSection>
pub fn get_chunk_section_at(&self, block_y: i32) -> Option<&ChunkSection>
Get a chunk section (or subchunk) from the given block_y
value which is the y value of a block within
the chunk
Sourcepub fn get_block(
&self,
block_x: u32,
block_y: i32,
block_z: u32,
) -> Option<&BlockState>
pub fn get_block( &self, block_x: u32, block_y: i32, block_z: u32, ) -> Option<&BlockState>
Get a block from a chunk using block_{x,y,z}. The x and z coordinates are relative to the chunk, and the y coordinate is absolute, so (0, 0, 0) is block 0, 0 in the chunk and y=0 in the world.
Sourcepub fn get_block_from_absolute_coords(
&self,
block_x: u32,
block_y: i32,
block_z: u32,
) -> Option<&BlockState>
pub fn get_block_from_absolute_coords( &self, block_x: u32, block_y: i32, block_z: u32, ) -> Option<&BlockState>
Get a block from a chunk using block_{x,y,z}. The coordinates are absolute in the world, so (0, 0, 0) is the block at x=0, y=0, z=0.
Note: This is only truly valid if this chunk is the chunk which contains that block, otherwise it’s not correct.
Trait Implementations§
Source§impl Clone for ParsedChunk
impl Clone for ParsedChunk
Source§fn clone(&self) -> ParsedChunk
fn clone(&self) -> ParsedChunk
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParsedChunk
impl Debug for ParsedChunk
Source§impl Deref for ParsedChunk
impl Deref for ParsedChunk
Source§impl PartialEq for ParsedChunk
impl PartialEq for ParsedChunk
impl StructuralPartialEq for ParsedChunk
Auto Trait Implementations§
impl Freeze for ParsedChunk
impl RefUnwindSafe for ParsedChunk
impl Send for ParsedChunk
impl Sync for ParsedChunk
impl Unpin for ParsedChunk
impl UnwindSafe for ParsedChunk
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