Record Class ItemPredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.item.ItemPredicate
Record Components:
tag -
items -
count -
durability -
enchantments -
storedEnchantments -
potion -
nbt -

public record ItemPredicate(Optional<TagKey<Item>> tag, Optional<RegistryEntryList<Item>> items, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<RegistryEntry<Potion>> potion, Optional<NbtPredicate> nbt) extends Record
Mappings:
Namespace Name
official cb
intermediary net/minecraft/class_2073
named net/minecraft/predicate/item/ItemPredicate
official b
intermediary comp_1783
named tag
official c
intermediary comp_1784
named items
official d
intermediary comp_1785
named count
official e
intermediary comp_1786
named durability
official f
intermediary comp_1787
named enchantments
official g
intermediary comp_1788
named storedEnchantments
official h
intermediary comp_1789
named potion
official i
intermediary comp_1790
named nbt
  • Field Details

    • tag

      private final Optional<TagKey<Item>> tag
      The field for the tag record component.
    • 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.
    • durability

      private final NumberRange.IntRange durability
      The field for the durability record component.
    • enchantments

      private final List<EnchantmentPredicate> enchantments
      The field for the enchantments record component.
    • storedEnchantments

      private final List<EnchantmentPredicate> storedEnchantments
      The field for the storedEnchantments record component.
    • potion

      private final Optional<RegistryEntry<Potion>> potion
      The field for the potion record component.
    • nbt

      private final Optional<NbtPredicate> nbt
      The field for the nbt record component.
    • ITEM_ENTRY_LIST_CODEC

      private static final com.mojang.serialization.Codec<RegistryEntryList<Item>> ITEM_ENTRY_LIST_CODEC
      Mappings:
      Namespace Name Mixin selector
      official j Lcb;j:Lcom/mojang/serialization/Codec;
      intermediary field_45755 Lnet/minecraft/class_2073;field_45755:Lcom/mojang/serialization/Codec;
      named ITEM_ENTRY_LIST_CODEC Lnet/minecraft/predicate/item/ItemPredicate;ITEM_ENTRY_LIST_CODEC:Lcom/mojang/serialization/Codec;
    • CODEC

      public static final com.mojang.serialization.Codec<ItemPredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lcb;a:Lcom/mojang/serialization/Codec;
      intermediary field_45754 Lnet/minecraft/class_2073;field_45754:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/predicate/item/ItemPredicate;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • ItemPredicate

      public ItemPredicate(Optional<TagKey<Item>> optional, Optional<RegistryEntryList<Item>> optional2, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> list, List<EnchantmentPredicate> list2, Optional<RegistryEntry<Potion>> optional3, Optional<NbtPredicate> optional4)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcb;<init>(Ljava/util/Optional;Ljava/util/Optional;Lcl$d;Lcl$d;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
      intermediary <init> Lnet/minecraft/class_2073;<init>(Ljava/util/Optional;Ljava/util/Optional;Lnet/minecraft/class_2096$class_2100;Lnet/minecraft/class_2096$class_2100;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
      named <init> Lnet/minecraft/predicate/item/ItemPredicate;<init>(Ljava/util/Optional;Ljava/util/Optional;Lnet/minecraft/predicate/NumberRange$IntRange;Lnet/minecraft/predicate/NumberRange$IntRange;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
  • Method Details

    • test

      public boolean test(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lcb;a(Lcjf;)Z
      intermediary method_8970 Lnet/minecraft/class_2073;method_8970(Lnet/minecraft/class_1799;)Z
      named test Lnet/minecraft/predicate/item/ItemPredicate;test(Lnet/minecraft/item/ItemStack;)Z
    • fromJson

      public static Optional<ItemPredicate> fromJson(@Nullable @Nullable com.google.gson.JsonElement el)
      Mappings:
      Namespace Name Mixin selector
      official a Lcb;a(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
      intermediary method_8969 Lnet/minecraft/class_2073;method_8969(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
      named fromJson Lnet/minecraft/predicate/item/ItemPredicate;fromJson(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
    • toJson

      public com.google.gson.JsonElement toJson()
      Mappings:
      Namespace Name Mixin selector
      official a Lcb;a()Lcom/google/gson/JsonElement;
      intermediary method_8971 Lnet/minecraft/class_2073;method_8971()Lcom/google/gson/JsonElement;
      named toJson Lnet/minecraft/predicate/item/ItemPredicate;toJson()Lcom/google/gson/JsonElement;
    • toJson

      public static com.google.gson.JsonElement toJson(List<ItemPredicate> predicates)
      Mappings:
      Namespace Name Mixin selector
      official a Lcb;a(Ljava/util/List;)Lcom/google/gson/JsonElement;
      intermediary method_53164 Lnet/minecraft/class_2073;method_53164(Ljava/util/List;)Lcom/google/gson/JsonElement;
      named toJson Lnet/minecraft/predicate/item/ItemPredicate;toJson(Ljava/util/List;)Lcom/google/gson/JsonElement;
    • deserializeAll

      public static List<ItemPredicate> deserializeAll(@Nullable @Nullable com.google.gson.JsonElement el)
      Mappings:
      Namespace Name Mixin selector
      official b Lcb;b(Lcom/google/gson/JsonElement;)Ljava/util/List;
      intermediary method_8972 Lnet/minecraft/class_2073;method_8972(Lcom/google/gson/JsonElement;)Ljava/util/List;
      named deserializeAll Lnet/minecraft/predicate/item/ItemPredicate;deserializeAll(Lcom/google/gson/JsonElement;)Ljava/util/List;
    • 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.
    • tag

      public Optional<TagKey<Item>> tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component
    • 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
    • durability

      public NumberRange.IntRange durability()
      Returns the value of the durability record component.
      Returns:
      the value of the durability record component
    • enchantments

      public List<EnchantmentPredicate> enchantments()
      Returns the value of the enchantments record component.
      Returns:
      the value of the enchantments record component
    • storedEnchantments

      public List<EnchantmentPredicate> storedEnchantments()
      Returns the value of the storedEnchantments record component.
      Returns:
      the value of the storedEnchantments record component
    • potion

      public Optional<RegistryEntry<Potion>> potion()
      Returns the value of the potion record component.
      Returns:
      the value of the potion record component
    • nbt

      public Optional<NbtPredicate> nbt()
      Returns the value of the nbt record component.
      Returns:
      the value of the nbt record component