Record Class ItemPredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.item.ItemPredicate
Record Components:
items -
count -
components -
subPredicates -
All Implemented Interfaces:
Predicate<ItemStack>

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 cs
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
  • Field Details

    • items

      private final Optional<RegistryEntryList<Item>> items
      The field for the items record component.
    • count

      private final NumberRange.IntRange count
      The field for the count record component.
    • components

      private final ComponentPredicate components
      The field for the components record component.
    • subPredicates

      private final Map<ItemSubPredicate.Type<?>,ItemSubPredicate> subPredicates
      The field for the subPredicates record component.
    • CODEC

      public static final com.mojang.serialization.Codec<ItemPredicate> 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 Lcs;a:Lcom/mojang/serialization/Codec;
  • Constructor Details

  • Method Details

    • test

      public boolean test(ItemStack stack)
      Specified by:
      test in 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 Lcs;a(Lcuq;)Z
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • items

      public Optional<RegistryEntryList<Item>> items()
      Returns the value of the items record component.
      Returns:
      the value of the items record component
    • count

      public NumberRange.IntRange count()
      Returns the value of the count record component.
      Returns:
      the value of the count record component
    • components

      public ComponentPredicate components()
      Returns the value of the components record component.
      Returns:
      the value of the components record component
    • subPredicates

      public Map<ItemSubPredicate.Type<?>,ItemSubPredicate> subPredicates()
      Returns the value of the subPredicates record component.
      Returns:
      the value of the subPredicates record component