Struct mc_core::world::chunk::SubChunk [−][src]
pub struct SubChunk { /* fields omitted */ }Expand description
A sub chunk, 16x16x16 blocks.
Implementations
Construct a new sub chunk with the given level environment. The default block is the “null-block” which is the block with save ID 0 in the global blocks palette (which is air in vanilla global palette).
pub fn set_block(
&mut self,
x: u8,
y: u8,
z: u8,
state: &'static BlockState
) -> ChunkResult<()>
pub fn set_block(
&mut self,
x: u8,
y: u8,
z: u8,
state: &'static BlockState
) -> ChunkResult<()>
Caution
This method will not update heightmaps of the owner chunk.
Force fill all the sub chunk with the given block state.
pub unsafe fn set_blocks_raw<I>(
&mut self,
palette: Vec<&'static BlockState>,
blocks: I
) where
I: Iterator<Item = usize>,
pub unsafe fn set_blocks_raw<I>(
&mut self,
palette: Vec<&'static BlockState>,
blocks: I
) where
I: Iterator<Item = usize>,
Safety:
You must ensure that the given palette contains only valid states for this chunk’s level’s environment.
The blocks iterator must return only valid indices for the given palette.
Iterate over all blocks in this chunk, ordered by X, Z then Y.
