Class FabricLanguageProvider
java.lang.Object
net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider
- All Implemented Interfaces:
DataProvider
Extend this class and implement
generateTranslations(net.minecraft.registry.RegistryWrapper.WrapperLookup, net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider.TranslationBuilder)
.
Make sure to use FabricLanguageProvider
to declare what language code is being generated if it isn't en_us
.
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
Modifier and TypeClassDescriptionstatic interface
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
FabricLanguageProvider
(FabricDataOutput dataOutput, String languageCode, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) protected
FabricLanguageProvider
(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
generateTranslations
(RegistryWrapper.WrapperLookup registryLookup, FabricLanguageProvider.TranslationBuilder translationBuilder) Implement this method to register languages.getName()
run
(DataWriter writer)
-
Field Details
-
dataOutput
-
-
Constructor Details
-
FabricLanguageProvider
protected FabricLanguageProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) -
FabricLanguageProvider
protected FabricLanguageProvider(FabricDataOutput dataOutput, String languageCode, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup)
-
-
Method Details
-
generateTranslations
public abstract void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, FabricLanguageProvider.TranslationBuilder translationBuilder) Implement this method to register languages.Call
FabricLanguageProvider.TranslationBuilder.add(String, String)
to add a translation. -
run
- Specified by:
run
in interfaceDataProvider
-
getName
- Specified by:
getName
in interfaceDataProvider
-