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, boolean requiredNonEmpty)
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.private final booleanThe field for therequiredNonEmptyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRegistryData(ResourceKey<? extends Registry<T>> p_251360_, com.mojang.serialization.Codec<T> p_248976_) RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec, boolean requiredNonEmpty) 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.booleanReturns the value of therequiredNonEmptyrecord 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. -
requiredNonEmpty
private final boolean requiredNonEmptyThe field for therequiredNonEmptyrecord component.
-
-
Constructor Details
-
RegistryData
RegistryData(ResourceKey<? extends Registry<T>> p_251360_, com.mojang.serialization.Codec<T> p_248976_) -
RegistryData
public RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec, boolean requiredNonEmpty) Creates an instance of aRegistryDatarecord class.- Parameters:
key- the value for thekeyrecord componentelementCodec- the value for theelementCodecrecord componentrequiredNonEmpty- the value for therequiredNonEmptyrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
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
-
requiredNonEmpty
public boolean requiredNonEmpty()Returns the value of therequiredNonEmptyrecord component.- Returns:
- the value of the
requiredNonEmptyrecord component
-