Skip to main content

Column

Struct Column 

Source
pub struct Column { /* private fields */ }
Expand description

A loaded chunk column: 16 sections (None = all air), biomes and optional light.

Implementations§

Source§

impl Column

Source

pub fn empty() -> Self

An all-air column.

Source

pub fn raw(&self, x: i32, y: i32, z: i32) -> u16

Raw state at column-local x, z (only the low four bits are used) and world y. y outside 0..256 is air (0), as in vanilla.

Source

pub fn set_raw(&mut self, x: i32, y: i32, z: i32, state: u16)

Sets the raw state at column-local x, z and world y (ignored outside 0..256).

Source

pub fn block_entities(&self) -> impl Iterator<Item = ([u8; 3], &BlockEntity)>

Block entities as ([x, y, z] column-local, data), in arrival order. Empty unless crate::WorldConfig::block_entities is on.

Source

pub fn block_entity(&self, x: i32, y: i32, z: i32) -> Option<&BlockEntity>

The block entity at column-local x, z (low four bits) and world y.

Source

pub fn section(&self, index: usize) -> Option<&Section>

The section at index 0..16 (y >> 4); None when it is all air.

Source

pub fn biomes(&self) -> &Biomes

Biomes as received.

Source

pub fn block_light(&self, x: i32, y: i32, z: i32) -> Option<u8>

1.8 block light at column-local x, z and world y, when light is kept and the section was sent. Light is never recomputed after block changes.

Source

pub fn sky_light(&self, x: i32, y: i32, z: i32) -> Option<u8>

1.8 sky light (see Column::block_light); None also in dimensions without sky.

Source

pub fn section_count(&self) -> usize

Number of non-empty sections.

Source

pub fn heap_bytes(&self) -> usize

Heap bytes owned by this column (sections, biomes, light), excluding the map entry.

Trait Implementations§

Source§

impl Clone for Column

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Column

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Column

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Column

§

impl Freeze for Column

§

impl Move for Column

§

impl RefUnwindSafe for Column

§

impl Send for Column
where BoxRaw<Indexed>: Send, BoxRaw<Direct>: Send, BoxRaw<[u8; 256]>: Send, BoxRaw<[u16; 1024]>: Send, BoxRaw<[Option<SectionLight>; 16]>: Send, RawVecInner: Send, Bytes: Send, BoxRaw<str>: Send,

§

impl Sync for Column
where BoxRaw<Indexed>: Sync, BoxRaw<Direct>: Sync, BoxRaw<[u8; 256]>: Sync, BoxRaw<[u16; 1024]>: Sync, BoxRaw<[Option<SectionLight>; 16]>: Sync, RawVecInner: Sync, Bytes: Sync, BoxRaw<str>: Sync,

§

impl Unpin for Column
where Box<Indexed>: Unpin, Box<Direct>: Unpin, Box<[u8; 256]>: Unpin, Box<[u16; 1024]>: Unpin, Box<[Option<SectionLight>; 16]>: Unpin, *const u8 is !null: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Box<str>: Unpin,

§

impl UnsafeUnpin for Column

§

impl UnwindSafe for Column
where BoxRaw<Indexed>: UnwindSafe, BoxRaw<Direct>: UnwindSafe, BoxRaw<[u8; 256]>: UnwindSafe, BoxRaw<[u16; 1024]>: UnwindSafe, BoxRaw<[Option<SectionLight>; 16]>: UnwindSafe, RawVecInner: UnwindSafe, *const u8: UnwindSafe, Align8<*mut ()>: UnwindSafe, &'static Vtable: UnwindSafe, BoxRaw<str>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.