Record Class LazyRegistryEntryReference<T>

java.lang.Object
java.lang.Record
net.minecraft.registry.entry.LazyRegistryEntryReference<T>
Record Components:
contents -

public record LazyRegistryEntryReference<T>(com.mojang.datafixers.util.Either<RegistryEntry<T>,RegistryKey<T>> contents) extends Record
Mappings:
Namespace Name
named net/minecraft/registry/entry/LazyRegistryEntryReference
intermediary net/minecraft/class_9791
official dbw
named contents
intermediary comp_3636
official a
  • Field Details

  • Constructor Details

    • LazyRegistryEntryReference

      public LazyRegistryEntryReference(RegistryEntry<T> entry)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/registry/entry/LazyRegistryEntryReference;<init>(Lnet/minecraft/registry/entry/RegistryEntry;)V
      intermediary <init> Lnet/minecraft/class_9791;<init>(Lnet/minecraft/class_6880;)V
      official <init> Ldbw;<init>(Ljl;)V
    • LazyRegistryEntryReference

      public LazyRegistryEntryReference(RegistryKey<T> key)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/registry/entry/LazyRegistryEntryReference;<init>(Lnet/minecraft/registry/RegistryKey;)V
      intermediary <init> Lnet/minecraft/class_9791;<init>(Lnet/minecraft/class_5321;)V
      official <init> Ldbw;<init>(Lamd;)V
    • LazyRegistryEntryReference

      public LazyRegistryEntryReference(com.mojang.datafixers.util.Either<RegistryEntry<T>,RegistryKey<T>> either)
  • Method Details

    • createCodec

      public static <T> com.mojang.serialization.Codec<LazyRegistryEntryReference<T>> createCodec(RegistryKey<Registry<T>> registryRef, com.mojang.serialization.Codec<RegistryEntry<T>> entryCodec)
      Mappings:
      Namespace Name Mixin selector
      named createCodec Lnet/minecraft/registry/entry/LazyRegistryEntryReference;createCodec(Lnet/minecraft/registry/RegistryKey;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      intermediary method_60736 Lnet/minecraft/class_9791;method_60736(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      official a Ldbw;a(Lamd;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
    • createPacketCodec

      public static <T> PacketCodec<RegistryByteBuf,LazyRegistryEntryReference<T>> createPacketCodec(RegistryKey<Registry<T>> registryRef, PacketCodec<RegistryByteBuf,RegistryEntry<T>> entryPacketCodec)
      Mappings:
      Namespace Name Mixin selector
      named createPacketCodec Lnet/minecraft/registry/entry/LazyRegistryEntryReference;createPacketCodec(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/network/codec/PacketCodec;)Lnet/minecraft/network/codec/PacketCodec;
      intermediary method_60737 Lnet/minecraft/class_9791;method_60737(Lnet/minecraft/class_5321;Lnet/minecraft/class_9139;)Lnet/minecraft/class_9139;
      official a Ldbw;a(Lamd;Lzm;)Lzm;
    • resolveValue

      public Optional<T> resolveValue(Registry<T> registry)
      Mappings:
      Namespace Name Mixin selector
      named resolveValue Lnet/minecraft/registry/entry/LazyRegistryEntryReference;resolveValue(Lnet/minecraft/registry/Registry;)Ljava/util/Optional;
      intermediary method_60740 Lnet/minecraft/class_9791;method_60740(Lnet/minecraft/class_2378;)Ljava/util/Optional;
      official a Ldbw;a(Ljy;)Ljava/util/Optional;
    • resolveEntry

      public Optional<RegistryEntry<T>> resolveEntry(RegistryWrapper.WrapperLookup registries)
      Mappings:
      Namespace Name Mixin selector
      named resolveEntry Lnet/minecraft/registry/entry/LazyRegistryEntryReference;resolveEntry(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Ljava/util/Optional;
      intermediary method_60739 Lnet/minecraft/class_9791;method_60739(Lnet/minecraft/class_7225$class_7874;)Ljava/util/Optional;
      official a Ldbw;a(Ljn$a;)Ljava/util/Optional;
    • getKey

      public Optional<RegistryKey<T>> getKey()
      Mappings:
      Namespace Name Mixin selector
      named getKey Lnet/minecraft/registry/entry/LazyRegistryEntryReference;getKey()Ljava/util/Optional;
      intermediary method_67385 Lnet/minecraft/class_9791;method_67385()Ljava/util/Optional;
      official a Ldbw;a()Ljava/util/Optional;
    • 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.
    • contents

      public com.mojang.datafixers.util.Either<RegistryEntry<T>,RegistryKey<T>> contents()
      Returns the value of the contents record component.
      Returns:
      the value of the contents record component