Package net.minecraft.resources
Record Class RegistryDataLoader.RegistryData<T>
java.lang.Object
java.lang.Record
net.minecraft.resources.RegistryDataLoader.RegistryData<T>
- Enclosing class:
RegistryDataLoader
public static record RegistryDataLoader.RegistryData<T>(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec<T> The field for theelementCodecrecord component.private final ResourceKey<? extends Registry<T>> The field for thekeyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) Creates an instance of aRegistryDatarecord class. -
Method Summary
Modifier and TypeMethodDescription(package private) RegistryDataLoader.Loader<T> create(com.mojang.serialization.Lifecycle p_251662_, Map<ResourceKey<?>, Exception> p_251565_) com.mojang.serialization.Codec<T> Returns the value of theelementCodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ResourceKey<? extends Registry<T>> key()Returns the value of thekeyrecord component.voidrunWithArguments(BiConsumer<ResourceKey<? extends Registry<T>>, com.mojang.serialization.Codec<T>> p_312899_) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
key
The field for thekeyrecord component. -
elementCodec
The field for theelementCodecrecord component.
-
-
Constructor Details
-
RegistryData
public RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) Creates an instance of aRegistryDatarecord class.- Parameters:
key- the value for thekeyrecord componentelementCodec- the value for theelementCodecrecord component
-
-
Method Details
-
create
RegistryDataLoader.Loader<T> create(com.mojang.serialization.Lifecycle p_251662_, Map<ResourceKey<?>, Exception> p_251565_) -
runWithArguments
public void runWithArguments(BiConsumer<ResourceKey<? extends Registry<T>>, com.mojang.serialization.Codec<T>> p_312899_) -
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
-
elementCodec
Returns the value of theelementCodecrecord component.- Returns:
- the value of the
elementCodecrecord component
-