Class FabricLanguageProvider
java.lang.Object
net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider
- All Implemented Interfaces:
net.minecraft.data.DataProvider
public abstract class FabricLanguageProvider
extends Object
implements net.minecraft.data.DataProvider
Extend this class and implement
generateTranslations(TranslationBuilder)
.
Make sure to use FabricLanguageProvider(FabricDataGenerator, String)
FabricLanguageProvider} to declare what language code is being generated if it isn't en_us
.
Register an instance of the class with FabricDataGenerator.addProvider(java.util.function.Function<net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator, P>)
in a DataGeneratorEntrypoint
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A consumer used bygenerateTranslations(TranslationBuilder)
. -
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
SHA1
-
Constructor Summary
ModifierConstructorDescriptionprotected
FabricLanguageProvider
(FabricDataGenerator dataGenerator) protected
FabricLanguageProvider
(FabricDataGenerator dataGenerator, String languageCode) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
generateTranslations
(FabricLanguageProvider.TranslationBuilder translationBuilder) Implement this method to register languages.getName()
void
run
(net.minecraft.data.DataCache cache)
-
Field Details
-
dataGenerator
-
-
Constructor Details
-
FabricLanguageProvider
-
FabricLanguageProvider
-
-
Method Details
-
generateTranslations
public abstract void generateTranslations(FabricLanguageProvider.TranslationBuilder translationBuilder) Implement this method to register languages.Call
FabricLanguageProvider.TranslationBuilder.add(String, String)
to add a translation. -
run
- Specified by:
run
in interfacenet.minecraft.data.DataProvider
- Throws:
IOException
-
getName
- Specified by:
getName
in interfacenet.minecraft.data.DataProvider
-