Package net.minecraft.predicate.item
Record Class ItemPredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.item.ItemPredicate
- Record Components:
- items-
- count-
- components-
- subPredicates-
public record ItemPredicate(Optional<RegistryEntryList<Item>> items, NumberRange.IntRange count, ComponentPredicate components, Map<ItemSubPredicate.Type<?>,ItemSubPredicate> subPredicates)
extends Record
implements Predicate<ItemStack> 
- Mappings:
- Namespace - Name - named - net/minecraft/predicate/item/ItemPredicate- intermediary - net/minecraft/class_2073- official - cv- named - items- intermediary - comp_1784- official - b- named - count- intermediary - comp_1785- official - c- named - components- intermediary - comp_2374- official - d- named - subPredicates- intermediary - comp_2462- official - e
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemPredicate> private final ComponentPredicateThe field for thecomponentsrecord component.private final NumberRange.IntRangeThe field for thecountrecord component.private final Optional<RegistryEntryList<Item>> The field for theitemsrecord component.private final Map<ItemSubPredicate.Type<?>, ItemSubPredicate> The field for thesubPredicatesrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionItemPredicate(Optional<RegistryEntryList<Item>> optional, NumberRange.IntRange intRange, ComponentPredicate componentPredicate, Map<ItemSubPredicate.Type<?>, ItemSubPredicate> map) 
- 
Method SummaryModifier 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.Returns the value of thesubPredicatesrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
- 
Field Details- 
itemsThe field for theitemsrecord component.
- 
countThe field for thecountrecord component.
- 
componentsThe field for thecomponentsrecord component.
- 
subPredicatesThe field for thesubPredicatesrecord component.
- 
CODEC- Mappings:
- Namespace - Name - Mixin selector - named - CODEC- Lnet/minecraft/predicate/item/ItemPredicate;CODEC:Lcom/mojang/serialization/Codec;- intermediary - field_45754- Lnet/minecraft/class_2073;field_45754:Lcom/mojang/serialization/Codec;- official - a- Lcv;a:Lcom/mojang/serialization/Codec;
 
 
- 
- 
Constructor Details- 
ItemPredicatepublic ItemPredicate(Optional<RegistryEntryList<Item>> optional, NumberRange.IntRange intRange, ComponentPredicate componentPredicate, Map<ItemSubPredicate.Type<?>, ItemSubPredicate> map) 
 
- 
- 
Method Details- 
test- Specified by:
- testin interface- Predicate<ItemStack>
- Mappings:
- Namespace - Name - Mixin selector - named - test- Lnet/minecraft/predicate/item/ItemPredicate;test(Lnet/minecraft/item/ItemStack;)Z- intermediary - method_8970- Lnet/minecraft/class_2073;method_8970(Lnet/minecraft/class_1799;)Z- official - a- Lcv;a(Lcwq;)Z
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
itemsReturns the value of theitemsrecord component.- Returns:
- the value of the itemsrecord component
 
- 
countReturns the value of thecountrecord component.- Returns:
- the value of the countrecord component
 
- 
componentsReturns the value of thecomponentsrecord component.- Returns:
- the value of the componentsrecord component
 
- 
subPredicatesReturns the value of thesubPredicatesrecord component.- Returns:
- the value of the subPredicatesrecord component
 
 
-