pub enum HeightmapType {
WorldSurface,
MotionBlocking,
MotionBlockingNoLeaves,
OceanFloor,
WorldSurfaceWg,
OceanFloorWg,
}Expand description
The different types of heightmaps.
Variants§
WorldSurface
Tracks the highest non-air block. Used for world surface calculations.
MotionBlocking
Tracks the highest motion-blocking block (solid or fluid).
MotionBlockingNoLeaves
Tracks the highest motion-blocking block that is not leaves.
OceanFloor
Tracks the highest solid block (ocean floor).
WorldSurfaceWg
Worldgen version of WorldSurface.
OceanFloorWg
Worldgen version of OceanFloor.
Implementations§
Source§impl HeightmapType
impl HeightmapType
const WORLD_SURFACE_MASK: u8
const MOTION_BLOCKING_MASK: u8
const MOTION_BLOCKING_NO_LEAVES_MASK: u8
const OCEAN_FLOOR_MASK: u8
const WORLD_SURFACE_WG_MASK: u8
const OCEAN_FLOOR_WG_MASK: u8
Sourcepub const fn worldgen_types() -> &'static [HeightmapType]
pub const fn worldgen_types() -> &'static [HeightmapType]
Returns worldgen heightmap types (used before CARVERS status).
Sourcepub const fn final_types() -> &'static [HeightmapType]
pub const fn final_types() -> &'static [HeightmapType]
Returns final heightmap types (used at CARVERS status and after).
Sourcepub const fn all_types() -> &'static [HeightmapType]
pub const fn all_types() -> &'static [HeightmapType]
Returns all heightmap types in their stable persistence order.
pub(crate) const fn persistence_id(self) -> u8
pub(crate) const fn from_persistence_id(id: u8) -> Option<Self>
Sourcepub fn is_opaque(self, state: BlockStateId) -> bool
pub fn is_opaque(self, state: BlockStateId) -> bool
Returns whether a block is “opaque” for this heightmap type. This determines whether the block counts towards the heightmap.
§Panics
Panics if the block state ID is invalid.
const fn mask(self) -> u8
Trait Implementations§
Source§impl Clone for HeightmapType
impl Clone for HeightmapType
Source§fn clone(&self) -> HeightmapType
fn clone(&self) -> HeightmapType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HeightmapType
Source§impl Debug for HeightmapType
impl Debug for HeightmapType
Source§impl DowncastType for HeightmapType
impl DowncastType for HeightmapType
Source§const TYPE_KEY: DowncastTypeKey
const TYPE_KEY: DowncastTypeKey
The process-wide key for this concrete type.
impl Eq for HeightmapType
Source§impl Hash for HeightmapType
impl Hash for HeightmapType
Source§impl PartialEq for HeightmapType
impl PartialEq for HeightmapType
impl StructuralPartialEq for HeightmapType
Auto Trait Implementations§
impl Freeze for HeightmapType
impl RefUnwindSafe for HeightmapType
impl Send for HeightmapType
impl Sync for HeightmapType
impl Unpin for HeightmapType
impl UnsafeUnpin for HeightmapType
impl UnwindSafe for HeightmapType
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<T> Component for T
impl<T> Component for T
fn clone_component(&self) -> Box<dyn Component>
fn component_eq(&self, other: &(dyn Component + 'static)) -> bool
Source§impl<T> Downcast for Twhere
T: ErasedType + ?Sized,
impl<T> Downcast for Twhere
T: ErasedType + ?Sized,
Source§fn is<T>(&self) -> boolwhere
T: DowncastType,
fn is<T>(&self) -> boolwhere
T: DowncastType,
Returns whether the erased value has concrete type
T.Source§fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastType,
fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastType,
Returns the erased value as
T when its key matches.Source§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: DowncastType,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: DowncastType,
Returns the erased value as mutable
T when its key matches.§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
Checks if this value is equivalent to the given key. Read more
§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.§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
Compares
self with key and returns true if they are equal.Source§impl<T> ErasedType for Twhere
T: DowncastType,
impl<T> ErasedType for Twhere
T: DowncastType,
fn downcast_type_key(&self) -> DowncastTypeKey
fn downcast_data(&self) -> *const ()
fn downcast_data_mut(&mut self) -> *mut ()
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>