pub struct SubChunk {
pub palette: Vec<Block>,
pub sky_block_light_array: [Light; 4096],
pub biome_array: [Biome; 64],
/* private fields */
}
Fields§
§palette: Vec<Block>
All kinds of blocks
sky_block_light_array: [Light; 4096]
Skylight, yzx
biome_array: [Biome; 64]
Biomes, zx
Implementations§
Trait Implementations§
Source§impl HasPalette for SubChunk
impl HasPalette for SubChunk
fn palette(&self) -> &[Block]
Source§fn find_in_palette(&self, block: &Block) -> Option<u16>
fn find_in_palette(&self, block: &Block) -> Option<u16>
Find the block index of a block in palette
Source§fn block_index_of_air(&self) -> Option<u16>
fn block_index_of_air(&self) -> Option<u16>
Returns the block index of air in this region
Source§fn block_index_of_structure_void(&self) -> Option<u16>
fn block_index_of_structure_void(&self) -> Option<u16>
Returns the block index of structure void in this region
Source§impl WorldSlice for SubChunk
impl WorldSlice for SubChunk
Source§fn total_blocks(&self, include_air: bool) -> u64
fn total_blocks(&self, include_air: bool) -> u64
Returns the count of blocks in region. Air will be counted if
include_air
is true, structure
void is never counted.Source§fn block_index_at(&self, r_pos: [i32; 3]) -> Option<u16>
fn block_index_at(&self, r_pos: [i32; 3]) -> Option<u16>
Get block index at
r_pos
, returns None
if the block is outside the regionSource§fn block_at(&self, r_pos: [i32; 3]) -> Option<&Block>
fn block_at(&self, r_pos: [i32; 3]) -> Option<&Block>
Get block at
r_pos
, returns None
if the block is outside the regionSource§fn block_entity_at(&self, _r_pos: [i32; 3]) -> Option<&BlockEntity>
fn block_entity_at(&self, _r_pos: [i32; 3]) -> Option<&BlockEntity>
Get block entity at
r_pos
Source§fn pending_tick_at(&self, _r_pos: [i32; 3]) -> &[PendingTick]
fn pending_tick_at(&self, _r_pos: [i32; 3]) -> &[PendingTick]
Get pending tick at
r_pos
Source§fn block_info_at(
&self,
r_pos: [i32; 3],
) -> Option<(u16, &Block, Option<&BlockEntity>, &[PendingTick])>
fn block_info_at( &self, r_pos: [i32; 3], ) -> Option<(u16, &Block, Option<&BlockEntity>, &[PendingTick])>
Returns detailed block infos at
r_pos
, including block index, block, block entity and pending tick.
Returns None
if the block is outside the regionAuto Trait Implementations§
impl Freeze for SubChunk
impl RefUnwindSafe for SubChunk
impl Send for SubChunk
impl Sync for SubChunk
impl Unpin for SubChunk
impl UnwindSafe for SubChunk
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more