Record Class TagKey<T>

java.lang.Object
java.lang.Record
net.minecraft.registry.tag.TagKey<T>
Record Components:
registryRef -
id -

public record TagKey<T>(RegistryKey<? extends Registry<T>> registryRef, Identifier id) extends Record
Mappings:
Namespace Name
named net/minecraft/registry/tag/TagKey
intermediary net/minecraft/class_6862
official axf
named registryRef
intermediary comp_326
official a
named id
intermediary comp_327
official b
  • Field Details Link icon

    • registryRef Link icon

      private final RegistryKey<? extends Registry<T>> registryRef
      The field for the registryRef record component.
    • id Link icon

      private final Identifier id
      The field for the id record component.
    • INTERNER Link icon

      private static final Interner<TagKey<?>> INTERNER
      Mappings:
      Namespace Name Mixin selector
      named INTERNER Lnet/minecraft/registry/tag/TagKey;INTERNER:Lcom/google/common/collect/Interner;
      intermediary field_36394 Lnet/minecraft/class_6862;field_36394:Lcom/google/common/collect/Interner;
      official c Laxf;c:Lcom/google/common/collect/Interner;
  • Constructor Details Link icon

    • TagKey Link icon

      @Deprecated public TagKey(RegistryKey<? extends Registry<T>> registryRef, Identifier id)
      Deprecated.
      Creates an instance of a TagKey record class.
      Parameters:
      registryRef - the value for the registryRef record component
      id - the value for the id record component
  • Method Details Link icon

    • unprefixedCodec Link icon

      public static <T> com.mojang.serialization.Codec<TagKey<T>> unprefixedCodec(RegistryKey<? extends Registry<T>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      named unprefixedCodec Lnet/minecraft/registry/tag/TagKey;unprefixedCodec(Lnet/minecraft/registry/RegistryKey;)Lcom/mojang/serialization/Codec;
      intermediary method_40090 Lnet/minecraft/class_6862;method_40090(Lnet/minecraft/class_5321;)Lcom/mojang/serialization/Codec;
      official a Laxf;a(Laku;)Lcom/mojang/serialization/Codec;
    • codec Link icon

      public static <T> com.mojang.serialization.Codec<TagKey<T>> codec(RegistryKey<? extends Registry<T>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      named codec Lnet/minecraft/registry/tag/TagKey;codec(Lnet/minecraft/registry/RegistryKey;)Lcom/mojang/serialization/Codec;
      intermediary method_40093 Lnet/minecraft/class_6862;method_40093(Lnet/minecraft/class_5321;)Lcom/mojang/serialization/Codec;
      official b Laxf;b(Laku;)Lcom/mojang/serialization/Codec;
    • packetCodec Link icon

      public static <T> PacketCodec<ByteBuf,TagKey<T>> packetCodec(RegistryKey<? extends Registry<T>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      named packetCodec Lnet/minecraft/registry/tag/TagKey;packetCodec(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/network/codec/PacketCodec;
      intermediary method_64143 Lnet/minecraft/class_6862;method_64143(Lnet/minecraft/class_5321;)Lnet/minecraft/class_9139;
      official c Laxf;c(Laku;)Lyn;
    • of Link icon

      public static <T> TagKey<T> of(RegistryKey<? extends Registry<T>> registryRef, Identifier id)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/registry/tag/TagKey;of(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/util/Identifier;)Lnet/minecraft/registry/tag/TagKey;
      intermediary method_40092 Lnet/minecraft/class_6862;method_40092(Lnet/minecraft/class_5321;Lnet/minecraft/class_2960;)Lnet/minecraft/class_6862;
      official a Laxf;a(Laku;Lakv;)Laxf;
    • isOf Link icon

      public boolean isOf(RegistryKey<? extends Registry<?>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      named isOf Lnet/minecraft/registry/tag/TagKey;isOf(Lnet/minecraft/registry/RegistryKey;)Z
      intermediary method_41007 Lnet/minecraft/class_6862;method_41007(Lnet/minecraft/class_5321;)Z
      official d Laxf;d(Laku;)Z
    • tryCast Link icon

      public <E> Optional<TagKey<E>> tryCast(RegistryKey<? extends Registry<E>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      named tryCast Lnet/minecraft/registry/tag/TagKey;tryCast(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
      intermediary method_41008 Lnet/minecraft/class_6862;method_41008(Lnet/minecraft/class_5321;)Ljava/util/Optional;
      official e Laxf;e(Laku;)Ljava/util/Optional;
    • toString Link icon

      public 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. 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.
    • registryRef Link icon

      public RegistryKey<? extends Registry<T>> registryRef()
      Returns the value of the registryRef record component.
      Returns:
      the value of the registryRef record component
    • id Link icon

      public Identifier id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component