pub struct BlockState(/* private fields */);Expand description
A 1.8 block state: block_id << 4 | meta, exactly the wire / chunk-section value.
Implementations§
Source§impl BlockState
impl BlockState
Sourcepub const AIR: BlockState
pub const AIR: BlockState
Air (raw 0).
Sourcepub const fn from_raw(raw: u16) -> Option<BlockState>
pub const fn from_raw(raw: u16) -> Option<BlockState>
Wraps a raw id << 4 | meta value; None if the block id is not a 1.8 block.
Sourcepub fn from_raw_vanilla(raw: u16) -> BlockState
pub fn from_raw_vanilla(raw: u16) -> BlockState
Vanilla’s chunk-read mapping: unknown block ids and unregistered metas become air.
Sourcepub fn is_registered(self) -> bool
pub fn is_registered(self) -> bool
true when vanilla 1.8.9 has a block state for this (id, meta); otherwise it reads as air.
Sourcepub const fn new(block: Block, meta: u8) -> BlockState
pub const fn new(block: Block, meta: u8) -> BlockState
Builds a state from a block and metadata (meta & 15).
Sourcepub fn collision(self) -> Collision
pub fn collision(self) -> Collision
Collision boxes, what else they depend on, and how vanilla places them in the world
(Collision::world_box). Hot path: three table lookups.
Trait Implementations§
Source§impl Clone for BlockState
impl Clone for BlockState
impl Copy for BlockState
Source§impl Debug for BlockState
impl Debug for BlockState
impl Eq for BlockState
Source§impl Hash for BlockState
impl Hash for BlockState
Source§impl Ord for BlockState
impl Ord for BlockState
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for BlockState
impl PartialEq for BlockState
Source§impl PartialOrd for BlockState
impl PartialOrd for BlockState
impl StructuralPartialEq for BlockState
Auto Trait Implementations§
impl Forget for BlockState
impl Freeze for BlockState
impl RefUnwindSafe for BlockState
impl Send for BlockState
impl Sync for BlockState
impl Unpin for BlockState
impl UnsafeUnpin for BlockState
impl UnwindSafe for BlockState
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