Package dev.latvian.mods.kubejs.registry
Record Class RegistryType<T>
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.registry.RegistryType<T>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRegistryType(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Class<?> baseClass, dev.latvian.mods.rhino.type.TypeInfo type) Creates an instance of aRegistryTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<RegistryType<T>> allOfClass(Class<T> type) Class<?> Returns the value of thebaseClassrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key()Returns the value of thekeyrecord component.static @Nullable RegistryType<?> lookup(dev.latvian.mods.rhino.type.TypeInfo target) static <T> @Nullable RegistryType<T> 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> voidregister(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, dev.latvian.mods.rhino.type.TypeInfo type) toString()Returns a string representation of this record class.dev.latvian.mods.rhino.type.TypeInfotype()Returns the value of thetyperecord component.
-
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 aRegistryTyperecord class.- Parameters:
key- the value for thekeyrecord componentbaseClass- the value for thebaseClassrecord componenttype- the value for thetyperecord 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
-
allOfClass
-
lookup
@Nullable public static @Nullable RegistryType<?> lookup(dev.latvian.mods.rhino.type.TypeInfo target) -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
baseClass
Returns the value of thebaseClassrecord component.- Returns:
- the value of the
baseClassrecord component
-
type
public dev.latvian.mods.rhino.type.TypeInfo type()Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-