Record Class ItemPredicate
java.lang.Object
java.lang.Record
net.minestom.server.item.predicate.ItemPredicate
public record ItemPredicate(@Nullable RegistryTag<Material> items, Range.Int count, @Nullable DataComponentPredicates predicates)
extends Record
implements Predicate<ItemStack>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<ItemPredicate> static final NetworkBuffer.Type<ItemPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionItemPredicate(List<Material> items) ItemPredicate(DataComponentPredicates predicates) ItemPredicate(@Nullable RegistryTag<Material> items, Range.Int count, @Nullable DataComponentPredicates predicates) Creates an instance of aItemPredicaterecord class.ItemPredicate(Range.Int count, @Nullable List<Material> items) -
Method Summary
Modifier and TypeMethodDescriptioncount()Returns the value of thecountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.items()Returns the value of theitemsrecord component.Returns the value of thepredicatesrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
NETWORK_TYPE
-
-
Constructor Details
-
ItemPredicate
-
ItemPredicate
-
ItemPredicate
-
ItemPredicate
public ItemPredicate(@Nullable @Nullable RegistryTag<Material> items, @Nullable Range.Int count, @Nullable @Nullable DataComponentPredicates predicates) Creates an instance of aItemPredicaterecord class.- Parameters:
items- the value for theitemsrecord componentcount- the value for thecountrecord componentpredicates- the value for thepredicatesrecord component
-
-
Method Details
-
test
-
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). -
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-
count
-
predicates
Returns the value of thepredicatesrecord component.- Returns:
- the value of the
predicatesrecord component
-