ChunkStorage

Struct ChunkStorage 

Source
pub struct ChunkStorage { /* private fields */ }

Implementations§

Source§

impl ChunkStorage

Source

pub fn get_chunks_count(&self) -> usize

Source

pub fn insert_chunk(&mut self, chunk: Chunk) -> &Arc<RwLock<Chunk>>

Insert a chunk at a specific position.

Source

pub fn get_chunk_arc(&self, cx: i32, cz: i32) -> Option<Arc<RwLock<Chunk>>>

Source

pub fn is_chunk_loaded(&self, cx: i32, cz: i32) -> bool

Return true if a chunk is loaded at a specific position.

Source

pub fn get_chunk(&self, cx: i32, cz: i32) -> Option<RwLockReadGuard<'_, Chunk>>

Get a chunk reference at specific coordinates.

Source

pub fn get_chunk_mut( &self, cx: i32, cz: i32, ) -> Option<RwLockWriteGuard<'_, Chunk>>

Get a mutable chunk reference at specific coordinates.

Source

pub fn get_chunk_at(&self, x: i32, z: i32) -> Option<RwLockReadGuard<'_, Chunk>>

Get a chunk reference at specific blocks coordinates.

Source

pub fn get_chunk_at_mut( &self, x: i32, z: i32, ) -> Option<RwLockWriteGuard<'_, Chunk>>

Get a mutable chunk reference at specific blocks coordinates.

Source

pub fn get_chunk_at_block( &self, block_pos: BlockPos, ) -> Option<RwLockReadGuard<'_, Chunk>>

Source

pub fn get_chunk_at_block_mut( &self, block_pos: BlockPos, ) -> Option<RwLockWriteGuard<'_, Chunk>>

Source

pub fn set_block_at( &self, x: i32, y: i32, z: i32, block: &'static BlockState, ) -> ChunkResult<()>

Source

pub fn get_block_at( &self, x: i32, y: i32, z: i32, ) -> ChunkResult<&'static BlockState>

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> Component for T
where T: Send + Sync + 'static,