Record Class TagPredicate<T>

java.lang.Object
java.lang.Record
net.minecraft.predicate.TagPredicate<T>
Record Components:
tag -
expected -

public record TagPredicate<T>(TagKey<T> tag, boolean expected) extends Record
Mappings:
Namespace Name
named net/minecraft/predicate/TagPredicate
intermediary net/minecraft/class_8129
official eh
named tag
intermediary comp_1836
official a
named expected
intermediary comp_1837
official b
  • Field Details Link icon

    • tag Link icon

      private final TagKey<T> tag
      The field for the tag record component.
    • expected Link icon

      private final boolean expected
      The field for the expected record component.
  • Constructor Details Link icon

    • TagPredicate Link icon

      public TagPredicate(TagKey<T> tag, boolean expected)
      Creates an instance of a TagPredicate record class.
      Parameters:
      tag - the value for the tag record component
      expected - the value for the expected record component
  • Method Details Link icon

    • createCodec Link icon

      public static <T> com.mojang.serialization.Codec<TagPredicate<T>> createCodec(RegistryKey<? extends Registry<T>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      named createCodec Lnet/minecraft/predicate/TagPredicate;createCodec(Lnet/minecraft/registry/RegistryKey;)Lcom/mojang/serialization/Codec;
      intermediary method_53245 Lnet/minecraft/class_8129;method_53245(Lnet/minecraft/class_5321;)Lcom/mojang/serialization/Codec;
      official a Leh;a(Laku;)Lcom/mojang/serialization/Codec;
    • expected Link icon

      public static <T> TagPredicate<T> expected(TagKey<T> tag)
      Mappings:
      Namespace Name Mixin selector
      named expected Lnet/minecraft/predicate/TagPredicate;expected(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/predicate/TagPredicate;
      intermediary method_48965 Lnet/minecraft/class_8129;method_48965(Lnet/minecraft/class_6862;)Lnet/minecraft/class_8129;
      official a Leh;a(Laxf;)Leh;
    • unexpected Link icon

      public static <T> TagPredicate<T> unexpected(TagKey<T> tag)
      Mappings:
      Namespace Name Mixin selector
      named unexpected Lnet/minecraft/predicate/TagPredicate;unexpected(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/predicate/TagPredicate;
      intermediary method_48968 Lnet/minecraft/class_8129;method_48968(Lnet/minecraft/class_6862;)Lnet/minecraft/class_8129;
      official b Leh;b(Laxf;)Leh;
    • test Link icon

      public boolean test(RegistryEntry<T> registryEntry)
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/predicate/TagPredicate;test(Lnet/minecraft/registry/entry/RegistryEntry;)Z
      intermediary method_48967 Lnet/minecraft/class_8129;method_48967(Lnet/minecraft/class_6880;)Z
      official a Leh;a(Ljr;)Z
    • toString Link icon

      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 Link icon

      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 Link icon

      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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 Link icon

      public TagKey<T> tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component
    • expected Link icon

      public boolean expected()
      Returns the value of the expected record component.
      Returns:
      the value of the expected record component