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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionRegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) Creates an instance of aRegistryDatarecord class.
- 
Method SummaryModifier and TypeMethodDescription(package private) com.mojang.datafixers.util.Pair<WritableRegistry<?>,RegistryDataLoader.Loader> 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.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
keyThe field for thekeyrecord component.
- 
elementCodecThe field for theelementCodecrecord component.
 
- 
- 
Constructor Details- 
RegistryDatapublic RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) Creates an instance of aRegistryDatarecord class.- Parameters:
- key- the value for the- keyrecord component
- elementCodec- the value for the- elementCodecrecord component
 
 
- 
- 
Method Details- 
createcom.mojang.datafixers.util.Pair<WritableRegistry<?>,RegistryDataLoader.Loader> create(com.mojang.serialization.Lifecycle p_251662_, Map<ResourceKey<?>, Exception> p_251565_) 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
keyReturns the value of thekeyrecord component.- Returns:
- the value of the keyrecord component
 
- 
elementCodecReturns the value of theelementCodecrecord component.- Returns:
- the value of the elementCodecrecord component
 
 
-