Record Class RegistryType<T>

java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.registry.RegistryType<T>

public record RegistryType<T>(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<?> baseClass, dev.latvian.mods.rhino.type.TypeInfo type) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegistryType(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<?> baseClass, dev.latvian.mods.rhino.type.TypeInfo type)
    Creates an instance of a RegistryType record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> List<RegistryType<T>>
    allOfClass(Class<T> type)
     
    Returns the value of the baseClass record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
    key()
    Returns the value of the key record component.
    static @Nullable RegistryType<?>
    lookup(dev.latvian.mods.rhino.type.TypeInfo target)
     
    static <T> @Nullable RegistryType<T>
    ofClass(Class<T> type)
     
    static <T> @Nullable RegistryType<T>
    ofKey(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key)
     
    static @Nullable RegistryType<?>
    ofType(dev.latvian.mods.rhino.type.TypeInfo typeInfo)
     
    static <T> void
    register(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, dev.latvian.mods.rhino.type.TypeInfo type)
     
    Returns a string representation of this record class.
    dev.latvian.mods.rhino.type.TypeInfo
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RegistryType

      public RegistryType(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<?> baseClass, dev.latvian.mods.rhino.type.TypeInfo type)
      Creates an instance of a RegistryType record class.
      Parameters:
      key - the value for the key record component
      baseClass - the value for the baseClass record component
      type - the value for the type record component
  • Method Details

    • register

      public static <T> void register(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, dev.latvian.mods.rhino.type.TypeInfo type)
    • ofKey

      @Nullable public static <T> @Nullable RegistryType<T> ofKey(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key)
    • ofType

      @Nullable public static @Nullable RegistryType<?> ofType(dev.latvian.mods.rhino.type.TypeInfo typeInfo)
    • ofClass

      @Nullable public static <T> @Nullable RegistryType<T> ofClass(Class<T> type)
    • allOfClass

      public static <T> List<RegistryType<T>> allOfClass(Class<T> type)
    • lookup

      @Nullable public static @Nullable RegistryType<?> lookup(dev.latvian.mods.rhino.type.TypeInfo target)
    • 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
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • baseClass

      public Class<?> baseClass()
      Returns the value of the baseClass record component.
      Returns:
      the value of the baseClass record component
    • type

      public dev.latvian.mods.rhino.type.TypeInfo type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component