Package net.minecraft.predicate.item
Record Class ItemPredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.item.ItemPredicate
- Record Components:
items-count-components-
public record ItemPredicate(Optional<RegistryEntryList<Item>> items, NumberRange.IntRange count, ComponentsPredicate components)
extends Record
implements Predicate<ItemStack>
- Mappings:
Namespace Name named net/minecraft/predicate/item/ItemPredicateintermediary net/minecraft/class_2073official cnnamed itemsintermediary comp_1784official bnamed countintermediary comp_1785official cnamed componentsintermediary comp_2374official d
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemPredicate> private final ComponentsPredicateThe field for thecomponentsrecord component.private final NumberRange.IntRangeThe field for thecountrecord component.private final Optional<RegistryEntryList<Item>> The field for theitemsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemPredicate(Optional<RegistryEntryList<Item>> optional, NumberRange.IntRange intRange, ComponentsPredicate componentsPredicate) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.count()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.booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
items
The field for theitemsrecord component. -
count
The field for thecountrecord component. -
components
The field for thecomponentsrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/predicate/item/ItemPredicate;CODEC:Lcom/mojang/serialization/Codec;intermediary field_45754Lnet/minecraft/class_2073;field_45754:Lcom/mojang/serialization/Codec;official aLcn;a:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
ItemPredicate
public ItemPredicate(Optional<RegistryEntryList<Item>> optional, NumberRange.IntRange intRange, ComponentsPredicate componentsPredicate)
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<ItemStack>- Mappings:
Namespace Name Mixin selector named testLnet/minecraft/predicate/item/ItemPredicate;test(Lnet/minecraft/item/ItemStack;)Zintermediary method_8970Lnet/minecraft/class_2073;method_8970(Lnet/minecraft/class_1799;)Zofficial aLcn;a(Ldak;)Z
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-