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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addLanguage
(String id, String texture) This method adds a newLanguage
with the given id and texture.This returns the chat prefix for our messages.protected io.github.bakedlibs.dough.config.Config
abstract Language
getDefaultMessages
(String key) Returns the Strings referring to the specified KeygetItemGroupName
(Player p, NamespacedKey key) getKeys
(FileConfiguration... files) abstract Language
getLanguage
(String id) This method attempts to return theLanguage
with the given language code.abstract Language
abstract Collection<Language>
This method returns a fullCollection
of everyLanguage
that 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 boolean
hasLanguage
(String id) This returns whether aLanguage
with the given id exists within the project resources.protected void
This will load everyLanguagePreset
into memory.protected void
save()
Saves this Localization to its Filevoid
sendActionbarMessage
(Player player, String key, boolean addPrefix) void
sendMessage
(CommandSender recipient, String key) void
sendMessage
(CommandSender recipient, String key, boolean addPrefix) void
sendMessage
(CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) void
sendMessage
(CommandSender recipient, String key, UnaryOperator<String> function) void
sendMessages
(CommandSender recipient, String key) void
sendMessages
(CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) void
sendMessages
(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 theLanguage
with the given language code.- Parameters:
id
- The language code- Returns:
- A
Language
with the given id or null
-
getLanguage
-
getDefaultLanguage
- Returns:
- The default
Language
-
hasLanguage
This returns whether aLanguage
with the given id exists within the project resources. -
getLanguages
This method returns a fullCollection
of everyLanguage
that was found.- Returns:
- A
Collection
that contains every installedLanguage
-
addLanguage
This method adds a newLanguage
with the given id and texture. -
loadEmbeddedLanguages
protected void loadEmbeddedLanguages()This will load everyLanguagePreset
into 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
-