pub struct ChunkPos(pub IVec2);Expand description
A chunk position.
Tuple Fields§
§0: IVec2Implementations§
Source§impl ChunkPos
impl ChunkPos
const OFFSETS: [(i32, i32); 8]
Sourceconst SAFETY_MARGIN_CHUNKS: i32
const SAFETY_MARGIN_CHUNKS: i32
Safety margin in chunks for world generation dependencies.
Calculated as (32 + GENERATION_PYRAMID.getStepTo(FULL).accumulatedDependencies().size() + 1) * 2.
The accumulated dependencies size for FULL is 9 (radius 8 + 1).
Sourcepub const MAX_COORDINATE_VALUE: i32
pub const MAX_COORDINATE_VALUE: i32
Maximum valid chunk coordinate value.
Calculated as SectionPos.blockToSectionCoord(MAX_HORIZONTAL_COORDINATE) - SAFETY_MARGIN_CHUNKS.
Sourcepub const fn new(x: i32, y: i32) -> Self
pub const fn new(x: i32, y: i32) -> Self
Creates a new ChunkPos with the given x and y coordinates.
Sourcepub const fn from_block_pos(pos: BlockPos) -> Self
pub const fn from_block_pos(pos: BlockPos) -> Self
Creates a ChunkPos from a world block position.
Sourcepub fn from_entity_pos(pos: DVec3) -> Self
pub fn from_entity_pos(pos: DVec3) -> Self
Creates a ChunkPos containing the given floating-point world position.
Trait Implementations§
impl Copy for ChunkPos
impl Eq for ChunkPos
Source§impl From<ChunkPos> for PackedChunkPos
impl From<ChunkPos> for PackedChunkPos
Source§impl From<PackedChunkPos> for ChunkPos
impl From<PackedChunkPos> for ChunkPos
Source§fn from(pos: PackedChunkPos) -> Self
fn from(pos: PackedChunkPos) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for ChunkPos
Auto Trait Implementations§
impl Freeze for ChunkPos
impl RefUnwindSafe for ChunkPos
impl Send for ChunkPos
impl Sync for ChunkPos
impl Unpin for ChunkPos
impl UnsafeUnpin for ChunkPos
impl UnwindSafe for ChunkPos
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.