Class FabricAdvancementProvider
java.lang.Object
net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider
- All Implemented Interfaces:
DataProvider
Extend this class and implement
generateAdvancement(net.minecraft.registry.RegistryWrapper.WrapperLookup, java.util.function.Consumer<net.minecraft.advancement.AdvancementEntry>)
.
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
FabricAdvancementProvider
(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
generateAdvancement
(RegistryWrapper.WrapperLookup registryLookup, Consumer<AdvancementEntry> consumer) Implement this method to register advancements to generate use the consumer callback to register advancements.getName()
run
(DataWriter writer) protected Consumer
<AdvancementEntry> withConditions
(Consumer<AdvancementEntry> exporter, ResourceCondition... conditions) Return a new exporter that applies the specified conditions to any advancement it receives.
-
Field Details
-
output
-
-
Constructor Details
-
FabricAdvancementProvider
protected FabricAdvancementProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup)
-
-
Method Details
-
generateAdvancement
public abstract void generateAdvancement(RegistryWrapper.WrapperLookup registryLookup, Consumer<AdvancementEntry> consumer) Implement this method to register advancements to generate use the consumer callback to register advancements.Use
Advancement.Builder.build(Consumer, String)
to help build advancements. -
withConditions
protected Consumer<AdvancementEntry> withConditions(Consumer<AdvancementEntry> exporter, ResourceCondition... conditions) Return a new exporter that applies the specified conditions to any advancement it receives. -
run
- Specified by:
run
in interfaceDataProvider
-
getName
- Specified by:
getName
in interfaceDataProvider
-