Package net.minecraft.registry.tag
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/TagKeyintermediary net/minecraft/class_6862official aycnamed registryRefintermediary comp_326official anamed idintermediary comp_327official b
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentifierThe field for theidrecord component.private final RegistryKey<? extends Registry<T>> The field for theregistryRefrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTagKey(RegistryKey<? extends Registry<T>> registryRef, Identifier id) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.mojang.serialization.Codec<TagKey<T>> codec(RegistryKey<? extends Registry<T>> registryRef) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanisOf(RegistryKey<? extends Registry<?>> registryRef) static <T> TagKey<T> of(RegistryKey<? extends Registry<T>> registryRef, Identifier id) static <T> PacketCodec<ByteBuf, TagKey<T>> packetCodec(RegistryKey<? extends Registry<T>> registryRef) RegistryKey<? extends Registry<T>> Returns the value of theregistryRefrecord component.toString()Returns a string representation of this record class.tryCast(RegistryKey<? extends Registry<E>> registryRef) static <T> com.mojang.serialization.Codec<TagKey<T>> unprefixedCodec(RegistryKey<? extends Registry<T>> registryRef)
-
Field Details
-
registryRef
The field for theregistryRefrecord component. -
id
The field for theidrecord component. -
INTERNER
- Mappings:
Namespace Name Mixin selector named INTERNERLnet/minecraft/registry/tag/TagKey;INTERNER:Lcom/google/common/collect/Interner;intermediary field_36394Lnet/minecraft/class_6862;field_36394:Lcom/google/common/collect/Interner;official cLayc;c:Lcom/google/common/collect/Interner;
-
-
Constructor Details
-
TagKey
Deprecated.Creates an instance of aTagKeyrecord class.- Parameters:
registryRef- the value for theregistryRefrecord componentid- the value for theidrecord component
-
-
Method Details
-
unprefixedCodec
public static <T> com.mojang.serialization.Codec<TagKey<T>> unprefixedCodec(RegistryKey<? extends Registry<T>> registryRef) - Mappings:
Namespace Name Mixin selector named unprefixedCodecLnet/minecraft/registry/tag/TagKey;unprefixedCodec(Lnet/minecraft/registry/RegistryKey;)Lcom/mojang/serialization/Codec;intermediary method_40090Lnet/minecraft/class_6862;method_40090(Lnet/minecraft/class_5321;)Lcom/mojang/serialization/Codec;official aLayc;a(Lalq;)Lcom/mojang/serialization/Codec;
-
codec
public static <T> com.mojang.serialization.Codec<TagKey<T>> codec(RegistryKey<? extends Registry<T>> registryRef) - Mappings:
Namespace Name Mixin selector named codecLnet/minecraft/registry/tag/TagKey;codec(Lnet/minecraft/registry/RegistryKey;)Lcom/mojang/serialization/Codec;intermediary method_40093Lnet/minecraft/class_6862;method_40093(Lnet/minecraft/class_5321;)Lcom/mojang/serialization/Codec;official bLayc;b(Lalq;)Lcom/mojang/serialization/Codec;
-
packetCodec
public static <T> PacketCodec<ByteBuf,TagKey<T>> packetCodec(RegistryKey<? extends Registry<T>> registryRef) - Mappings:
Namespace Name Mixin selector named packetCodecLnet/minecraft/registry/tag/TagKey;packetCodec(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/network/codec/PacketCodec;intermediary method_64143Lnet/minecraft/class_6862;method_64143(Lnet/minecraft/class_5321;)Lnet/minecraft/class_9139;official cLayc;c(Lalq;)Lze;
-
of
- Mappings:
Namespace Name Mixin selector named ofLnet/minecraft/registry/tag/TagKey;of(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/util/Identifier;)Lnet/minecraft/registry/tag/TagKey;intermediary method_40092Lnet/minecraft/class_6862;method_40092(Lnet/minecraft/class_5321;Lnet/minecraft/class_2960;)Lnet/minecraft/class_6862;official aLayc;a(Lalq;Lalr;)Layc;
-
isOf
- Mappings:
Namespace Name Mixin selector named isOfLnet/minecraft/registry/tag/TagKey;isOf(Lnet/minecraft/registry/RegistryKey;)Zintermediary method_41007Lnet/minecraft/class_6862;method_41007(Lnet/minecraft/class_5321;)Zofficial dLayc;d(Lalq;)Z
-
tryCast
- Mappings:
Namespace Name Mixin selector named tryCastLnet/minecraft/registry/tag/TagKey;tryCast(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;intermediary method_41008Lnet/minecraft/class_6862;method_41008(Lnet/minecraft/class_5321;)Ljava/util/Optional;official eLayc;e(Lalq;)Ljava/util/Optional;
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
registryRef
Returns the value of theregistryRefrecord component.- Returns:
- the value of the
registryRefrecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-