pub struct InteractionEntityDataView<'a> {
guard: MutexGuard<'a, InteractionEntityData>,
dimensions_changed: bool,
}Expand description
Provides an exclusive view of the synchronized entity data of an interaction entity.
This includes its width, its height, and the response boolean.
Fields§
§guard: MutexGuard<'a, InteractionEntityData>§dimensions_changed: boolImplementations§
Source§impl InteractionEntityDataView<'_>
impl InteractionEntityDataView<'_>
Sourcepub fn set_width(&mut self, width: f32)
pub fn set_width(&mut self, width: f32)
Sets the width of the bounding box of the interaction entity to the provided value.
Sourcepub fn set_height(&mut self, height: f32)
pub fn set_height(&mut self, height: f32)
Sets the height of the bounding box of the interaction entity to the provided value.
Sourcepub fn response(&self) -> bool
pub fn response(&self) -> bool
Gets whether interacting with the interaction entity will trigger a response
from the player. If true, this means that
- for left clicks, a punching sound will play, and
- for right clicks, the player’s hand will swing.
Sourcepub fn set_response(&mut self, response: bool)
pub fn set_response(&mut self, response: bool)
Sets whether interacting with the interaction entity will trigger a response
from the player. If set to true, this means that
- for left clicks, a punching sound will play, and
- for right clicks, the player’s hand will swing.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for InteractionEntityDataView<'a>
impl<'a> !Send for InteractionEntityDataView<'a>
impl<'a> !UnwindSafe for InteractionEntityDataView<'a>
impl<'a> Freeze for InteractionEntityDataView<'a>
impl<'a> Sync for InteractionEntityDataView<'a>
impl<'a> Unpin for InteractionEntityDataView<'a>
impl<'a> UnsafeUnpin for InteractionEntityDataView<'a>
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
§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<>>