pub struct BlockCollisionContext {
entity_bottom: Option<f64>,
fall_distance: f64,
can_walk_on_powder_snow: bool,
is_falling_block: bool,
descending: bool,
placement: bool,
}Expand description
Entity facts used by vanilla CollisionContext for block collision shapes.
Fields§
§entity_bottom: Option<f64>§fall_distance: f64§can_walk_on_powder_snow: bool§is_falling_block: bool§descending: bool§placement: boolImplementations§
Source§impl BlockCollisionContext
impl BlockCollisionContext
Sourcepub const fn entity(entity_bottom: f64, descending: bool) -> Self
pub const fn entity(entity_bottom: f64, descending: bool) -> Self
Collision context for normal entity movement.
Sourcepub const fn pre_move(entity_bottom: f64, descending: bool) -> Self
pub const fn pre_move(entity_bottom: f64, descending: bool) -> Self
Collision context for vanilla pre-move collision validation.
Sourcepub const fn position_context(y: f64) -> Self
pub const fn position_context(y: f64) -> Self
Collision context for vanilla CollisionContext.positionContext(y).
Sourcepub const fn with_fall_distance(self, fall_distance: f64) -> Self
pub const fn with_fall_distance(self, fall_distance: f64) -> Self
Returns a copy with vanilla accumulated fall distance.
Sourcepub const fn with_can_walk_on_powder_snow(
self,
can_walk_on_powder_snow: bool,
) -> Self
pub const fn with_can_walk_on_powder_snow( self, can_walk_on_powder_snow: bool, ) -> Self
Returns a copy with vanilla powder-snow walkability.
Sourcepub const fn with_falling_block(self, is_falling_block: bool) -> Self
pub const fn with_falling_block(self, is_falling_block: bool) -> Self
Returns a copy with vanilla falling-block collision context.
Sourcepub const fn fall_distance(self) -> f64
pub const fn fall_distance(self) -> f64
Returns accumulated vanilla fall distance for context-sensitive block collision.
Sourcepub const fn can_walk_on_powder_snow(self) -> bool
pub const fn can_walk_on_powder_snow(self) -> bool
Returns whether the source entity can walk on powder snow.
Sourcepub const fn is_falling_block(self) -> bool
pub const fn is_falling_block(self) -> bool
Returns whether the source entity is a vanilla falling block.
Sourcepub const fn is_descending(self) -> bool
pub const fn is_descending(self) -> bool
Returns whether the source entity is descending through context-sensitive blocks.
Sourcepub const fn is_placement(self) -> bool
pub const fn is_placement(self) -> bool
Returns whether this context is used for placement-style collision checks.
Trait Implementations§
Source§impl Clone for BlockCollisionContext
impl Clone for BlockCollisionContext
Source§fn clone(&self) -> BlockCollisionContext
fn clone(&self) -> BlockCollisionContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BlockCollisionContext
Source§impl Debug for BlockCollisionContext
impl Debug for BlockCollisionContext
Source§impl PartialEq for BlockCollisionContext
impl PartialEq for BlockCollisionContext
impl StructuralPartialEq for BlockCollisionContext
Auto Trait Implementations§
impl Freeze for BlockCollisionContext
impl RefUnwindSafe for BlockCollisionContext
impl Send for BlockCollisionContext
impl Sync for BlockCollisionContext
impl Unpin for BlockCollisionContext
impl UnsafeUnpin for BlockCollisionContext
impl UnwindSafe for BlockCollisionContext
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> 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> ⓘ
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> ⓘ
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 moreArc<SyncMutex<>>