Record Class RegistryPredicateArgumentType.TagBased<T>

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

private static record RegistryPredicateArgumentType.TagBased<T>(TagKey<T> key) extends Record implements RegistryPredicateArgumentType.RegistryPredicate<T>
Mappings:
Namespace Name
official es$d
intermediary net/minecraft/class_7066$class_7070
named net/minecraft/command/argument/RegistryPredicateArgumentType$TagBased
official a
intermediary comp_523
named key
  • Field Details

    • key

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

    • TagBased

      TagBased(TagKey<T> tagKey)
  • 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 Les$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 Les$c;a(Lacp;)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 Les$d;a(Lhe;)Z
      intermediary method_41180 Lnet/minecraft/class_7066$class_7070;method_41180(Lnet/minecraft/class_6880;)Z
      named test Lnet/minecraft/command/argument/RegistryPredicateArgumentType$TagBased;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 Les$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 TagKey<T> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component