Record Class CustomDataPredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.item.CustomDataPredicate
Record Components:
value -
All Implemented Interfaces:
ItemSubPredicate

public record CustomDataPredicate(NbtPredicate value) extends Record implements ItemSubPredicate
Mappings:
Namespace Name
named net/minecraft/predicate/item/CustomDataPredicate
intermediary net/minecraft/class_9354
official ci
named value
intermediary comp_2458
official c
  • Field Details

    • value

      private final NbtPredicate value
      The field for the value record component.
    • CODEC

      public static final com.mojang.serialization.Codec<CustomDataPredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/predicate/item/CustomDataPredicate;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_49797 Lnet/minecraft/class_9354;field_49797:Lcom/mojang/serialization/Codec;
      official a Lci;a:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • CustomDataPredicate

      public CustomDataPredicate(NbtPredicate nbtPredicate)
  • Method Details

    • test

      public boolean test(ItemStack stack)
      Specified by:
      test in interface ItemSubPredicate
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/predicate/item/ItemSubPredicate;test(Lnet/minecraft/item/ItemStack;)Z
      intermediary method_58161 Lnet/minecraft/class_9360;method_58161(Lnet/minecraft/class_1799;)Z
      official a Lcq;a(Lcur;)Z
    • customData

      public static CustomDataPredicate customData(NbtPredicate value)
      Mappings:
      Namespace Name Mixin selector
      named customData Lnet/minecraft/predicate/item/CustomDataPredicate;customData(Lnet/minecraft/predicate/NbtPredicate;)Lnet/minecraft/predicate/item/CustomDataPredicate;
      intermediary method_58162 Lnet/minecraft/class_9354;method_58162(Lnet/minecraft/class_2105;)Lnet/minecraft/class_9354;
      official a Lci;a(Ldg;)Lci;
    • 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.
    • value

      public NbtPredicate value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component