pub enum InteractionResult {
Success,
SuccessServer,
Consume,
Fail,
Pass,
TryEmptyHandInteraction,
}Expand description
Result of an interaction (item use, block use, etc.)
Variants§
Success
The interaction succeeded and consumed the action.
SuccessServer
The interaction succeeded and the server should broadcast the swing.
Consume
The interaction consumed the action without swinging.
Fail
The interaction failed and consumed the action.
Pass
The interaction did not apply; try the next handler.
TryEmptyHandInteraction
Try the empty-hand interaction on the block.
Implementations§
Source§impl InteractionResult
impl InteractionResult
Sourcepub const fn consumes_action(self) -> bool
pub const fn consumes_action(self) -> bool
Returns true if this result consumes the action (Success or Fail).
Pass and TryEmptyHandInteraction do not consume the action.
Sourcepub const fn should_swing_server(self) -> bool
pub const fn should_swing_server(self) -> bool
Returns true when vanilla requests the server to broadcast the swing.
Sourcepub const fn should_apply_item_use_side_effects(self) -> bool
pub const fn should_apply_item_use_side_effects(self) -> bool
Returns true for vanilla InteractionResult.Success variants that run
item-use side effects such as minecraft:use_cooldown.
Trait Implementations§
Source§impl Clone for InteractionResult
impl Clone for InteractionResult
Source§fn clone(&self) -> InteractionResult
fn clone(&self) -> InteractionResult
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 InteractionResult
Source§impl Debug for InteractionResult
impl Debug for InteractionResult
impl Eq for InteractionResult
Source§impl PartialEq for InteractionResult
impl PartialEq for InteractionResult
impl StructuralPartialEq for InteractionResult
Auto Trait Implementations§
impl Freeze for InteractionResult
impl RefUnwindSafe for InteractionResult
impl Send for InteractionResult
impl Sync for InteractionResult
impl Unpin for InteractionResult
impl UnsafeUnpin for InteractionResult
impl UnwindSafe for InteractionResult
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<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.§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<>>