Class FabricCodecDataProvider<T>
java.lang.Object
net.fabricmc.fabric.api.datagen.v1.provider.FabricCodecDataProvider<T>
- All Implemented Interfaces:
DataProvider
Extend this class and implement
configure(BiConsumer, RegistryWrapper.WrapperLookup)
.
Register an instance of the class with FabricDataGenerator.Pack.addProvider(net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator.Pack.Factory<T>)
in a DataGeneratorEntrypoint
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider
DataProvider.Factory<T extends DataProvider>
-
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
JSON_KEY_SORT_ORDER, JSON_KEY_SORTING_COMPARATOR, LOGGER
-
Constructor Summary
ModifierConstructorDescriptionprotected
FabricCodecDataProvider
(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture, DataOutput.OutputType outputType, String directoryName, com.mojang.serialization.Codec<T> codec) protected
FabricCodecDataProvider
(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture, RegistryKey<? extends Registry<?>> key, com.mojang.serialization.Codec<T> codec) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
configure
(BiConsumer<Identifier, T> provider, RegistryWrapper.WrapperLookup lookup) Implement this method to register entries to generate using aRegistryWrapper.WrapperLookup
.run
(DataWriter writer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.data.DataProvider
getName
-
Constructor Details
-
FabricCodecDataProvider
protected FabricCodecDataProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture, DataOutput.OutputType outputType, String directoryName, com.mojang.serialization.Codec<T> codec) -
FabricCodecDataProvider
protected FabricCodecDataProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture, RegistryKey<? extends Registry<?>> key, com.mojang.serialization.Codec<T> codec)
-
-
Method Details
-
run
- Specified by:
run
in interfaceDataProvider
-
configure
protected abstract void configure(BiConsumer<Identifier, T> provider, RegistryWrapper.WrapperLookup lookup) Implement this method to register entries to generate using aRegistryWrapper.WrapperLookup
.- Parameters:
provider
- A consumer that accepts anIdentifier
and a value to register.lookup
- A lookup for registries.
-