Record Class AttributeModifiersPredicate
java.lang.Object
java.lang.Record
net.minecraft.core.component.predicates.AttributeModifiersPredicate
- All Implemented Interfaces:
SingleComponentItemPredicate<ItemAttributeModifiers>, DataComponentPredicate
public record AttributeModifiersPredicate(Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> modifiers)
extends Record
implements SingleComponentItemPredicate<ItemAttributeModifiers>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface DataComponentPredicate
DataComponentPredicate.AnyValueType, DataComponentPredicate.ConcreteType<T>, DataComponentPredicate.Single<T>, DataComponentPredicate.Type<T>, DataComponentPredicate.TypeBase<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AttributeModifiersPredicate> private final Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> The field for themodifiersrecord component.Fields inherited from interface DataComponentPredicate
SINGLE_STREAM_CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifiersPredicate(Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> modifiers) Creates an instance of aAttributeModifiersPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(DataComponentGetter getter) booleanmatches(ItemAttributeModifiers value) Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> Returns the value of themodifiersrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
modifiers
private final Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> modifiersThe field for themodifiersrecord component. -
CODEC
-
-
Constructor Details
-
AttributeModifiersPredicate
public AttributeModifiersPredicate(Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> modifiers) Creates an instance of aAttributeModifiersPredicaterecord class.- Parameters:
modifiers- the value for themodifiersrecord component
-
-
Method Details
-
componentType
- Specified by:
componentTypein interfaceSingleComponentItemPredicate<ItemAttributeModifiers>
-
matches
- Specified by:
matchesin interfaceSingleComponentItemPredicate<ItemAttributeModifiers>
-
matches
- Specified by:
matchesin interfaceDataComponentPredicate- Specified by:
matchesin interfaceSingleComponentItemPredicate<ItemAttributeModifiers>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
modifiers
public Optional<CollectionPredicate<ItemAttributeModifiers.Entry, AttributeModifiersPredicate.EntryPredicate>> modifiers()Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-