pub struct EntityFallOnFacts {
pub entity_type: EntityTypeRef,
pub is_living_entity: bool,
pub bounding_box_width: f64,
pub bounding_box_height: f64,
pub fall_sounds: (SoundEventRef, SoundEventRef),
}Expand description
Entity facts needed by Block.fallOn.
Fields§
§entity_type: EntityTypeRefVanilla entity type of the landing entity.
is_living_entity: boolWhether the landing entity implements vanilla living-entity behavior.
bounding_box_width: f64Current entity bounding-box X/Z width.
bounding_box_height: f64Current entity bounding-box height.
fall_sounds: (SoundEventRef, SoundEventRef)Vanilla small and big living-entity fall sounds.
Implementations§
Source§impl EntityFallOnFacts
impl EntityFallOnFacts
Sourcepub const fn new(
entity_type: EntityTypeRef,
is_living_entity: bool,
bounding_box_width: f64,
bounding_box_height: f64,
fall_sounds: (SoundEventRef, SoundEventRef),
) -> Self
pub const fn new( entity_type: EntityTypeRef, is_living_entity: bool, bounding_box_width: f64, bounding_box_height: f64, fall_sounds: (SoundEventRef, SoundEventRef), ) -> Self
Creates fall-on facts from explicit entity values.
Sourcepub fn from_entity(entity: &dyn Entity) -> Self
pub fn from_entity(entity: &dyn Entity) -> Self
Creates fall-on facts from an entity.
Sourcepub fn bounding_box_width_squared_height(self) -> f64
pub fn bounding_box_width_squared_height(self) -> f64
Vanilla farmland trampling size check:
getBbWidth() * getBbWidth() * getBbHeight().
Trait Implementations§
Source§impl Clone for EntityFallOnFacts
impl Clone for EntityFallOnFacts
Source§fn clone(&self) -> EntityFallOnFacts
fn clone(&self) -> EntityFallOnFacts
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 EntityFallOnFacts
Source§impl Debug for EntityFallOnFacts
impl Debug for EntityFallOnFacts
Source§impl PartialEq for EntityFallOnFacts
impl PartialEq for EntityFallOnFacts
impl StructuralPartialEq for EntityFallOnFacts
Auto Trait Implementations§
impl Freeze for EntityFallOnFacts
impl RefUnwindSafe for EntityFallOnFacts
impl Send for EntityFallOnFacts
impl Sync for EntityFallOnFacts
impl Unpin for EntityFallOnFacts
impl UnsafeUnpin for EntityFallOnFacts
impl UnwindSafe for EntityFallOnFacts
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> 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<>>