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
Modifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec
<T> The field for theelementCodec
record component.private final ResourceKey
<? extends Registry<T>> The field for thekey
record component. -
Constructor Summary
ConstructorDescriptionRegistryData
(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) Creates an instance of aRegistryData
record 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 theelementCodec
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.ResourceKey
<? extends Registry<T>> key()
Returns the value of thekey
record component.void
runWithArguments
(BiConsumer<ResourceKey<? extends Registry<T>>, com.mojang.serialization.Codec<T>> p_312899_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
key
The field for thekey
record component. -
elementCodec
The field for theelementCodec
record component.
-
-
Constructor Details
-
RegistryData
public RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) Creates an instance of aRegistryData
record class.- Parameters:
key
- the value for thekey
record componentelementCodec
- the value for theelementCodec
record 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 thekey
record component.- Returns:
- the value of the
key
record component
-
elementCodec
Returns the value of theelementCodec
record component.- Returns:
- the value of the
elementCodec
record component
-