Class AbstractTranslationsRegistry
java.lang.Object
net.minheur.potoflux.translations.AbstractTranslationsRegistry
- Direct Known Subclasses:
CommonTranslations,FileTranslations,PotoFluxTranslations
Abstract registry for a lang
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassBuilder for translations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates aAbstractTranslationsRegistry.TranslationBuilderwith a raw keyCreates aAbstractTranslationsRegistry.TranslationBuilderwith a main key and children (separated by a.)addCommand(String id, String... children) Adds a translation for a commandaddCommandUse(String id, String... children) Adds a translation for a command usageAdds a translation for a tabGetter for themodTranslations.protected abstract voidActual method to register translations.voidActually fill upmodTranslations.
-
Constructor Details
-
AbstractTranslationsRegistry
Creates a reg, from the modID- Parameters:
modId- themodIdof the mod creating translations
-
-
Method Details
-
registerTranslations
public void registerTranslations()Actually fill upmodTranslations. -
getTranslations
Getter for themodTranslations.- Returns:
modTranslations
-
makeTranslation
protected abstract void makeTranslation()Actual method to register translations. -
add
Creates aAbstractTranslationsRegistry.TranslationBuilderwith a raw key- Parameters:
key- the full key of the translation- Returns:
- the new
AbstractTranslationsRegistry.TranslationBuilder
-
add
Creates aAbstractTranslationsRegistry.TranslationBuilderwith a main key and children (separated by a.)- Parameters:
mainKey- the main key of the translationchildren- all other keys to add- Returns:
- the new
AbstractTranslationsRegistry.TranslationBuilder
-
addTab
Adds a translation for a tab- Parameters:
id- the ID of the tabchildren- the optional children of the translation- Returns:
- the new
AbstractTranslationsRegistry.TranslationBuilder
-
addCommand
Adds a translation for a command- Parameters:
id- the ID of the commandchildren- the optional children of the translation- Returns:
- the new
AbstractTranslationsRegistry.TranslationBuilder
-
addCommandUse
protected AbstractTranslationsRegistry.TranslationBuilder addCommandUse(String id, String... children) Adds a translation for a command usage- Parameters:
id- the ID of the commandchildren- the optional children of the translation- Returns:
- the new
AbstractTranslationsRegistry.TranslationBuilder
-