Class SlimefunLocalization
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.localization.SlimefunLocalization
- All Implemented Interfaces:
Keyed
- Direct Known Subclasses:
LocalizationService
This is an abstract parent class of
LocalizationService.
There is not really much more I can say besides that...- Author:
- TheBusyBiscuit
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddLanguage(String id, String texture) This method adds a newLanguagewith the given id and texture.This returns the chat prefix for our messages.protected io.github.bakedlibs.dough.config.Configabstract LanguagegetDefaultMessages(String key) Returns the Strings referring to the specified KeygetItemGroupName(Player p, NamespacedKey key) getKeys(FileConfiguration... files) abstract LanguagegetLanguage(String id) This method attempts to return theLanguagewith the given language code.abstract Languageabstract Collection<Language>This method returns a fullCollectionof everyLanguagethat was found.getMessage(String key) getMessage(Player p, String key) getMessages(Player p, String key) getMessages(Player p, String key, UnaryOperator<String> function) getRecipeTypeItem(Player p, RecipeType recipeType) getResearchName(Player p, NamespacedKey key) getResourceString(Player p, String key) getTotalKeys(Language lang) protected abstract booleanhasLanguage(String id) This returns whether aLanguagewith the given id exists within the project resources.protected voidThis will load everyLanguagePresetinto memory.protected voidsave()Saves this Localization to its FilevoidsendActionbarMessage(Player player, String key, boolean addPrefix) voidsendMessage(CommandSender recipient, String key) voidsendMessage(CommandSender recipient, String key, boolean addPrefix) voidsendMessage(CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) voidsendMessage(CommandSender recipient, String key, UnaryOperator<String> function) voidsendMessages(CommandSender recipient, String key) voidsendMessages(CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) voidsendMessages(CommandSender recipient, String key, UnaryOperator<String> function)
-
Constructor Details
-
SlimefunLocalization
-
-
Method Details
-
getConfig
@Nonnull protected io.github.bakedlibs.dough.config.Config getConfig() -
save
protected void save()Saves this Localization to its File -
getChatPrefix
This returns the chat prefix for our messages. Every message (unless explicitly omitted) will have this prefix prepended.- Returns:
- The chat prefix
-
getLanguage
This method attempts to return theLanguagewith the given language code.- Parameters:
id- The language code- Returns:
- A
Languagewith the given id or null
-
getLanguage
-
getDefaultLanguage
- Returns:
- The default
Language
-
hasLanguage
This returns whether aLanguagewith the given id exists within the project resources. -
getLanguages
This method returns a fullCollectionof everyLanguagethat was found.- Returns:
- A
Collectionthat contains every installedLanguage
-
addLanguage
This method adds a newLanguagewith the given id and texture. -
loadEmbeddedLanguages
protected void loadEmbeddedLanguages()This will load everyLanguagePresetinto memory. To be precise: It performsaddLanguage(String, String)for every value ofLanguagePreset. -
getMessage
-
getMessage
-
getDefaultMessages
Returns the Strings referring to the specified Key- Parameters:
key- The Key of those Messages- Returns:
- The List this key is referring to
-
getMessages
-
getMessages
-
getResearchName
-
getItemGroupName
-
getResourceString
-
getRecipeTypeItem
-
sendMessage
-
sendActionbarMessage
-
sendMessage
-
sendMessage
@ParametersAreNonnullByDefault public void sendMessage(CommandSender recipient, String key, UnaryOperator<String> function) -
sendMessage
@ParametersAreNonnullByDefault public void sendMessage(CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) -
sendMessages
-
sendMessages
@ParametersAreNonnullByDefault public void sendMessages(CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) -
sendMessages
@ParametersAreNonnullByDefault public void sendMessages(CommandSender recipient, String key, UnaryOperator<String> function) -
getTotalKeys
-
getKeys
-