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, RegistryValidator<T> validator, Consumer<RegistryBuilder<T>> registryBuilderConsumer)
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 Consumer<RegistryBuilder<T>> The field for theregistryBuilderConsumerrecord component.private final RegistryValidator<T> The field for thevalidatorrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec, RegistryValidator<T> validator) RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec, RegistryValidator<T> validator, Consumer<RegistryBuilder<T>> registryBuilderConsumer) Creates an instance of aRegistryDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.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.Returns the value of theregistryBuilderConsumerrecord component.voidrunWithArguments(BiConsumer<ResourceKey<? extends Registry<T>>, com.mojang.serialization.Codec<T>> output) final StringtoString()Returns a string representation of this record class.Returns the value of thevalidatorrecord component.
-
Field Details
-
key
The field for thekeyrecord component. -
elementCodec
The field for theelementCodecrecord component. -
validator
The field for thevalidatorrecord component. -
registryBuilderConsumer
The field for theregistryBuilderConsumerrecord component.
-
-
Constructor Details
-
RegistryData
public RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec, RegistryValidator<T> validator) -
RegistryData
private RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec) -
RegistryData
public RegistryData(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Codec<T> elementCodec, RegistryValidator<T> validator, Consumer<RegistryBuilder<T>> registryBuilderConsumer) Creates an instance of aRegistryDatarecord class.- Parameters:
key- the value for thekeyrecord componentelementCodec- the value for theelementCodecrecord componentvalidator- the value for thevalidatorrecord componentregistryBuilderConsumer- the value for theregistryBuilderConsumerrecord component
-
-
Method Details
-
runWithArguments
public void runWithArguments(BiConsumer<ResourceKey<? extends Registry<T>>, com.mojang.serialization.Codec<T>> output) -
toString
-
hashCode
-
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
-
validator
Returns the value of thevalidatorrecord component.- Returns:
- the value of the
validatorrecord component
-
registryBuilderConsumer
Returns the value of theregistryBuilderConsumerrecord component.- Returns:
- the value of the
registryBuilderConsumerrecord component
-