Record Class RegistryPredicateArgumentType.RegistryKeyBased<T>

java.lang.Object
java.lang.Record
net.minecraft.command.argument.RegistryPredicateArgumentType.RegistryKeyBased<T>
Record Components:
key -
All Implemented Interfaces:
Predicate<RegistryEntry<T>>, RegistryPredicateArgumentType.RegistryPredicate<T>
Enclosing class:
RegistryPredicateArgumentType<T>

private static record RegistryPredicateArgumentType.RegistryKeyBased<T>(RegistryKey<T> key) extends Record implements RegistryPredicateArgumentType.RegistryPredicate<T>
Mappings:
Namespace Name
official er$b
intermediary net/minecraft/class_7066$class_7067
named net/minecraft/command/argument/RegistryPredicateArgumentType$RegistryKeyBased
official a
intermediary comp_522
named key
  • Field Details

    • key

      private final RegistryKey<T> key
      The field for the key record component.
  • Constructor Details

    • RegistryKeyBased

      RegistryKeyBased(RegistryKey<T> registryKey)
  • Method Details

    • getKey

      public com.mojang.datafixers.util.Either<RegistryKey<T>,TagKey<T>> getKey()
      Specified by:
      getKey in interface RegistryPredicateArgumentType.RegistryPredicate<T>
      Mappings:
      Namespace Name Mixin selector
      official a Ler$c;a()Lcom/mojang/datafixers/util/Either;
      intermediary method_41173 Lnet/minecraft/class_7066$class_7068;method_41173()Lcom/mojang/datafixers/util/Either;
      named getKey Lnet/minecraft/command/argument/RegistryPredicateArgumentType$RegistryPredicate;getKey()Lcom/mojang/datafixers/util/Either;
    • tryCast

      public <E> Optional<RegistryPredicateArgumentType.RegistryPredicate<E>> tryCast(RegistryKey<? extends Registry<E>> registryRef)
      Specified by:
      tryCast in interface RegistryPredicateArgumentType.RegistryPredicate<T>
      Mappings:
      Namespace Name Mixin selector
      official a Ler$c;a(Ladc;)Ljava/util/Optional;
      intermediary method_41175 Lnet/minecraft/class_7066$class_7068;method_41175(Lnet/minecraft/class_5321;)Ljava/util/Optional;
      named tryCast Lnet/minecraft/command/argument/RegistryPredicateArgumentType$RegistryPredicate;tryCast(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
    • test

      public boolean test(RegistryEntry<T> registryEntry)
      Specified by:
      test in interface Predicate<T>
      Mappings:
      Namespace Name Mixin selector
      official a Ler$b;a(Lhd;)Z
      intermediary method_41174 Lnet/minecraft/class_7066$class_7067;method_41174(Lnet/minecraft/class_6880;)Z
      named test Lnet/minecraft/command/argument/RegistryPredicateArgumentType$RegistryKeyBased;test(Lnet/minecraft/registry/entry/RegistryEntry;)Z
    • asString

      public String asString()
      Specified by:
      asString in interface RegistryPredicateArgumentType.RegistryPredicate<T>
      Mappings:
      Namespace Name Mixin selector
      official b Ler$c;b()Ljava/lang/String;
      intermediary method_41176 Lnet/minecraft/class_7066$class_7068;method_41176()Ljava/lang/String;
      named asString Lnet/minecraft/command/argument/RegistryPredicateArgumentType$RegistryPredicate;asString()Ljava/lang/String;
    • 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.
    • key

      public RegistryKey<T> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component