pub struct ChunkSectionBiomePos {
pub x: u8,
pub y: u8,
pub z: u8,
}
Expand description
The coordinates of a chunk inside a chunk section. Each coordinate should be in the range 0..=3.
Fields§
§x: u8
§y: u8
§z: u8
Implementations§
Source§impl ChunkSectionBiomePos
impl ChunkSectionBiomePos
pub const fn new(x: u8, y: u8, z: u8) -> Self
Sourcepub fn length_squared(&self) -> u8
pub fn length_squared(&self) -> u8
Get the distance of this vector to the origin by doing x^2 + y^2 + z^2
.
Sourcepub fn distance_squared_to(&self, other: &Self) -> u8
pub fn distance_squared_to(&self, other: &Self) -> u8
Get the squared distance from this position to another position.
Equivalent to (self - other).length_squared()
.
pub fn horizontal_distance_squared(&self) -> u8
pub fn horizontal_distance_squared_to(&self, other: &Self) -> u8
Sourcepub fn down(&self, y: u8) -> Self
pub fn down(&self, y: u8) -> Self
Return a new instance of this position with the y coordinate decreased by the given number.
Sourcepub fn up(&self, y: u8) -> Self
pub fn up(&self, y: u8) -> Self
Return a new instance of this position with the y coordinate increased by the given number.
Sourcepub fn north(&self, z: u8) -> Self
pub fn north(&self, z: u8) -> Self
Return a new instance of this position with the z coordinate subtracted by the given number.
Sourcepub fn east(&self, x: u8) -> Self
pub fn east(&self, x: u8) -> Self
Return a new instance of this position with the x coordinate increased by the given number.
Sourcepub fn south(&self, z: u8) -> Self
pub fn south(&self, z: u8) -> Self
Return a new instance of this position with the z coordinate increased by the given number.
Sourcepub fn west(&self, x: u8) -> Self
pub fn west(&self, x: u8) -> Self
Return a new instance of this position with the x coordinate subtracted by the given number.
pub fn dot(&self, other: Self) -> u8
pub fn with_x(&self, x: u8) -> Self
pub fn with_y(&self, y: u8) -> Self
pub fn with_z(&self, z: u8) -> Self
Trait Implementations§
Source§impl Add<u8> for ChunkSectionBiomePos
impl Add<u8> for ChunkSectionBiomePos
Source§impl Add for &ChunkSectionBiomePos
impl Add for &ChunkSectionBiomePos
Source§impl Add for ChunkSectionBiomePos
impl Add for ChunkSectionBiomePos
Source§impl AddAssign for ChunkSectionBiomePos
impl AddAssign for ChunkSectionBiomePos
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl Clone for ChunkSectionBiomePos
impl Clone for ChunkSectionBiomePos
Source§fn clone(&self) -> ChunkSectionBiomePos
fn clone(&self) -> ChunkSectionBiomePos
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ChunkSectionBiomePos
impl Debug for ChunkSectionBiomePos
Source§impl Default for ChunkSectionBiomePos
impl Default for ChunkSectionBiomePos
Source§fn default() -> ChunkSectionBiomePos
fn default() -> ChunkSectionBiomePos
Source§impl Div<u8> for ChunkSectionBiomePos
impl Div<u8> for ChunkSectionBiomePos
Source§impl DivAssign<u8> for ChunkSectionBiomePos
impl DivAssign<u8> for ChunkSectionBiomePos
Source§fn div_assign(&mut self, divisor: u8)
fn div_assign(&mut self, divisor: u8)
/=
operation. Read moreSource§impl From<&ChunkBiomePos> for ChunkSectionBiomePos
impl From<&ChunkBiomePos> for ChunkSectionBiomePos
Source§fn from(pos: &ChunkBiomePos) -> Self
fn from(pos: &ChunkBiomePos) -> Self
Source§impl From<ChunkSectionBiomePos> for (u8, u8, u8)
impl From<ChunkSectionBiomePos> for (u8, u8, u8)
Source§fn from(pos: ChunkSectionBiomePos) -> Self
fn from(pos: ChunkSectionBiomePos) -> Self
Source§impl Mul<u8> for ChunkSectionBiomePos
impl Mul<u8> for ChunkSectionBiomePos
Source§impl MulAssign<u8> for ChunkSectionBiomePos
impl MulAssign<u8> for ChunkSectionBiomePos
Source§fn mul_assign(&mut self, multiplier: u8)
fn mul_assign(&mut self, multiplier: u8)
*=
operation. Read moreSource§impl PartialEq for ChunkSectionBiomePos
impl PartialEq for ChunkSectionBiomePos
Source§impl Rem<u8> for ChunkSectionBiomePos
impl Rem<u8> for ChunkSectionBiomePos
Source§impl Sub for &ChunkSectionBiomePos
impl Sub for &ChunkSectionBiomePos
Source§impl Sub for ChunkSectionBiomePos
impl Sub for ChunkSectionBiomePos
impl Copy for ChunkSectionBiomePos
impl Eq for ChunkSectionBiomePos
impl StructuralPartialEq for ChunkSectionBiomePos
Auto Trait Implementations§
impl Freeze for ChunkSectionBiomePos
impl RefUnwindSafe for ChunkSectionBiomePos
impl Send for ChunkSectionBiomePos
impl Sync for ChunkSectionBiomePos
impl Unpin for ChunkSectionBiomePos
impl UnwindSafe for ChunkSectionBiomePos
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DynEq for T
impl<T> DynEq for T
§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
key
and return true
if they are equal.§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.