Struct CurrentJavaChunk

Source
pub struct CurrentJavaChunk {
    pub data_version: i32,
    pub sections: Option<SectionTower<Section>>,
    pub heightmaps: Option<Heightmaps>,
    pub status: String,
    /* private fields */
}
Expand description

A Minecraft chunk.

This type is not designed for accessing all data of a chunk. It provides the data necessary to render maps for fastanvil. If you need more complete data you need to write your own chunk struct and implement the serde traits, or use fastnbt::Value.

Fields§

§data_version: i32§sections: Option<SectionTower<Section>>§heightmaps: Option<Heightmaps>§status: String

Implementations§

Trait Implementations§

Source§

impl Chunk for CurrentJavaChunk

Source§

fn status(&self) -> String

Source§

fn surface_height(&self, x: usize, z: usize, mode: HeightMode) -> isize

Get the height of the first air-like block above something not air-like. Will panic if given x/z coordinates outside of 0..16.
Source§

fn biome(&self, x: usize, y: isize, z: usize) -> Option<Biome>

Get the biome of the given coordinate. A biome may not exist if the section of the chunk accessed is not present. For example, trying to access the block at height 1234 would return None.
Source§

fn block(&self, x: usize, y: isize, z: usize) -> Option<&Block>

Get the block at the given coordinates. A block may not exist if the section of the chunk accessed is not present. For example, trying to access the block at height 1234 would return None.
Source§

fn y_range(&self) -> Range<isize>

Get the range of Y values that are valid for this chunk.
Source§

impl Debug for CurrentJavaChunk

Source§

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

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

impl<'de> Deserialize<'de> for CurrentJavaChunk

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<CurrentJavaChunk> for Chunk

Source§

fn from(current_java_chunk: CurrentJavaChunk) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,