Record Class EnchantmentPredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.item.EnchantmentPredicate
Record Components:
enchantments -
levels -

public record EnchantmentPredicate(Optional<RegistryEntryList<Enchantment>> enchantments, NumberRange.IntRange levels) extends Record
Mappings:
Namespace Name
named net/minecraft/predicate/item/EnchantmentPredicate
intermediary net/minecraft/class_2035
official br
named enchantments
intermediary comp_2665
official b
named levels
intermediary comp_1749
official c
  • Field Details

    • enchantments

      private final Optional<RegistryEntryList<Enchantment>> enchantments
      The field for the enchantments record component.
    • levels

      private final NumberRange.IntRange levels
      The field for the levels record component.
    • CODEC

      public static final com.mojang.serialization.Codec<EnchantmentPredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/predicate/item/EnchantmentPredicate;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_45741 Lnet/minecraft/class_2035;field_45741:Lcom/mojang/serialization/Codec;
      official a Lbr;a:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • EnchantmentPredicate

      public EnchantmentPredicate(RegistryEntry<Enchantment> enchantment, NumberRange.IntRange levels)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/predicate/item/EnchantmentPredicate;<init>(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/predicate/NumberRange$IntRange;)V
      intermediary <init> Lnet/minecraft/class_2035;<init>(Lnet/minecraft/class_6880;Lnet/minecraft/class_2096$class_2100;)V
      official <init> Lbr;<init>(Ljq;Ldj$d;)V
    • EnchantmentPredicate

      public EnchantmentPredicate(RegistryEntryList<Enchantment> enchantments, NumberRange.IntRange levels)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/predicate/item/EnchantmentPredicate;<init>(Lnet/minecraft/registry/entry/RegistryEntryList;Lnet/minecraft/predicate/NumberRange$IntRange;)V
      intermediary <init> Lnet/minecraft/class_2035;<init>(Lnet/minecraft/class_6885;Lnet/minecraft/class_2096$class_2100;)V
      official <init> Lbr;<init>(Lju;Ldj$d;)V
    • EnchantmentPredicate

      public EnchantmentPredicate(Optional<RegistryEntryList<Enchantment>> optional, NumberRange.IntRange intRange)
  • Method Details

    • test

      public boolean test(ItemEnchantmentsComponent enchantmentsComponent)
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/predicate/item/EnchantmentPredicate;test(Lnet/minecraft/component/type/ItemEnchantmentsComponent;)Z
      intermediary method_8880 Lnet/minecraft/class_2035;method_8880(Lnet/minecraft/class_9304;)Z
      official a Lbr;a(Ldee;)Z
    • testLevel

      private boolean testLevel(ItemEnchantmentsComponent enchantmentsComponent, RegistryEntry<Enchantment> enchantment)
      Mappings:
      Namespace Name Mixin selector
      named testLevel Lnet/minecraft/predicate/item/EnchantmentPredicate;testLevel(Lnet/minecraft/component/type/ItemEnchantmentsComponent;Lnet/minecraft/registry/entry/RegistryEntry;)Z
      intermediary method_59916 Lnet/minecraft/class_2035;method_59916(Lnet/minecraft/class_9304;Lnet/minecraft/class_6880;)Z
      official a Lbr;a(Ldee;Ljq;)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.
    • enchantments

      public Optional<RegistryEntryList<Enchantment>> enchantments()
      Returns the value of the enchantments record component.
      Returns:
      the value of the enchantments record component
    • levels

      public NumberRange.IntRange levels()
      Returns the value of the levels record component.
      Returns:
      the value of the levels record component