Record Class RegistryEntry.Direct<T>

java.lang.Object
java.lang.Record
net.minecraft.util.registry.RegistryEntry.Direct<T>
Record Components:
value -
All Implemented Interfaces:
RegistryEntry<T>
Enclosing interface:
RegistryEntry<T>

public static record RegistryEntry.Direct<T>(T value) extends Record implements RegistryEntry<T>
Mappings:
Namespace Name
official gs$a
intermediary net/minecraft/class_6880$class_6881
named net/minecraft/util/registry/RegistryEntry$Direct
official a
intermediary comp_349
named value
  • Field Details

    • value

      private final T value
      The field for the value record component.
  • Constructor Details

    • Direct

      public Direct(T t)
  • Method Details

    • hasKeyAndValue

      public boolean hasKeyAndValue()
      Specified by:
      hasKeyAndValue in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official b Lgs;b()Z
      intermediary method_40227 Lnet/minecraft/class_6880;method_40227()Z
      named hasKeyAndValue Lnet/minecraft/util/registry/RegistryEntry;hasKeyAndValue()Z
    • matchesId

      public boolean matchesId(Identifier id)
      Specified by:
      matchesId in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgs;a(Lyt;)Z
      intermediary method_40226 Lnet/minecraft/class_6880;method_40226(Lnet/minecraft/class_2960;)Z
      named matchesId Lnet/minecraft/util/registry/RegistryEntry;matchesId(Lnet/minecraft/util/Identifier;)Z
    • matchesKey

      public boolean matchesKey(RegistryKey<T> key)
      Specified by:
      matchesKey in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgs;a(Lys;)Z
      intermediary method_40225 Lnet/minecraft/class_6880;method_40225(Lnet/minecraft/class_5321;)Z
      named matchesKey Lnet/minecraft/util/registry/RegistryEntry;matchesKey(Lnet/minecraft/util/registry/RegistryKey;)Z
    • isIn

      public boolean isIn(TagKey<T> tag)
      Specified by:
      isIn in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgs;a(Laif;)Z
      intermediary method_40220 Lnet/minecraft/class_6880;method_40220(Lnet/minecraft/class_6862;)Z
      named isIn Lnet/minecraft/util/registry/RegistryEntry;isIn(Lnet/minecraft/tag/TagKey;)Z
    • matches

      public boolean matches(Predicate<RegistryKey<T>> predicate)
      Specified by:
      matches in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgs;a(Ljava/util/function/Predicate;)Z
      intermediary method_40224 Lnet/minecraft/class_6880;method_40224(Ljava/util/function/Predicate;)Z
      named matches Lnet/minecraft/util/registry/RegistryEntry;matches(Ljava/util/function/Predicate;)Z
    • getKeyOrValue

      public com.mojang.datafixers.util.Either<RegistryKey<T>,T> getKeyOrValue()
      Specified by:
      getKeyOrValue in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official d Lgs;d()Lcom/mojang/datafixers/util/Either;
      intermediary method_40229 Lnet/minecraft/class_6880;method_40229()Lcom/mojang/datafixers/util/Either;
      named getKeyOrValue Lnet/minecraft/util/registry/RegistryEntry;getKeyOrValue()Lcom/mojang/datafixers/util/Either;
    • getKey

      public Optional<RegistryKey<T>> getKey()
      Specified by:
      getKey in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official e Lgs;e()Ljava/util/Optional;
      intermediary method_40230 Lnet/minecraft/class_6880;method_40230()Ljava/util/Optional;
      named getKey Lnet/minecraft/util/registry/RegistryEntry;getKey()Ljava/util/Optional;
    • getType

      public RegistryEntry.Type getType()
      Specified by:
      getType in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official f Lgs;f()Lgs$b;
      intermediary method_40231 Lnet/minecraft/class_6880;method_40231()Lnet/minecraft/class_6880$class_6882;
      named getType Lnet/minecraft/util/registry/RegistryEntry;getType()Lnet/minecraft/util/registry/RegistryEntry$Type;
    • toString

      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
    • setRegistry

      public boolean setRegistry(Registry<T> registry)
      Specified by:
      setRegistry in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgs;a(Lhb;)Z
      intermediary method_40222 Lnet/minecraft/class_6880;method_40222(Lnet/minecraft/class_2378;)Z
      named setRegistry Lnet/minecraft/util/registry/RegistryEntry;setRegistry(Lnet/minecraft/util/registry/Registry;)Z
    • streamTags

      public Stream<TagKey<T>> streamTags()
      Specified by:
      streamTags in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official c Lgs;c()Ljava/util/stream/Stream;
      intermediary method_40228 Lnet/minecraft/class_6880;method_40228()Ljava/util/stream/Stream;
      named streamTags Lnet/minecraft/util/registry/RegistryEntry;streamTags()Ljava/util/stream/Stream;
    • 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 T value()
      Specified by:
      value in interface RegistryEntry<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lgs;a()Ljava/lang/Object;
      intermediary comp_349 Lnet/minecraft/class_6880;comp_349()Ljava/lang/Object;
      named value Lnet/minecraft/util/registry/RegistryEntry;value()Ljava/lang/Object;