pub struct BlockPredicate {
blocks: Option<RegistryHolderSet<Block>>,
state: Option<StatePropertiesPredicate>,
nbt: Option<NbtPredicate>,
components: DataComponentMatchers,
}Expand description
Vanilla block predicate used by adventure-mode item components.
Fields§
§blocks: Option<RegistryHolderSet<Block>>§state: Option<StatePropertiesPredicate>§nbt: Option<NbtPredicate>§components: DataComponentMatchersImplementations§
Source§impl BlockPredicate
impl BlockPredicate
pub const fn new( blocks: Option<RegistryHolderSet<Block>>, state: Option<StatePropertiesPredicate>, nbt: Option<NbtPredicate>, components: DataComponentMatchers, ) -> Self
pub const fn blocks(&self) -> Option<&RegistryHolderSet<Block>>
pub const fn state(&self) -> Option<&StatePropertiesPredicate>
pub const fn nbt(&self) -> Option<&NbtPredicate>
pub const fn components(&self) -> &DataComponentMatchers
Sourcepub fn matches_state(&self, state: BlockStateId) -> bool
pub fn matches_state(&self, state: BlockStateId) -> bool
Tests the block and state-property portions of this predicate.
fn from_owned_nbt(tag: &NbtTag) -> Option<Self>
fn to_nbt_tag_ref(&self) -> NbtTag
Trait Implementations§
Source§impl Clone for BlockPredicate
impl Clone for BlockPredicate
Source§fn clone(&self) -> BlockPredicate
fn clone(&self) -> BlockPredicate
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 moreSource§impl Debug for BlockPredicate
impl Debug for BlockPredicate
Source§impl HashComponent for BlockPredicate
impl HashComponent for BlockPredicate
Source§fn hash_component(&self, hasher: &mut ComponentHasher)
fn hash_component(&self, hasher: &mut ComponentHasher)
Hashes this value into the given hasher.
Source§fn compute_hash(&self) -> i32
fn compute_hash(&self) -> i32
Computes the hash of this value.
Source§impl PartialEq for BlockPredicate
impl PartialEq for BlockPredicate
Source§impl ReadFrom for BlockPredicate
impl ReadFrom for BlockPredicate
impl StructuralPartialEq for BlockPredicate
Auto Trait Implementations§
impl !RefUnwindSafe for BlockPredicate
impl !UnwindSafe for BlockPredicate
impl Freeze for BlockPredicate
impl Send for BlockPredicate
impl Sync for BlockPredicate
impl Unpin for BlockPredicate
impl UnsafeUnpin for BlockPredicate
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<>>