Class SlimefunLocalization
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.localization.SlimefunLocalization
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed
,org.bukkit.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 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
This method returns the defaultLanguage
of thisServer
getDefaultMessages
(String key) Returns the Strings referring to the specified KeygetItemGroupName
(org.bukkit.entity.Player p, org.bukkit.NamespacedKey key) getKeys
(org.bukkit.configuration.file.FileConfiguration... files) abstract Language
getLanguage
(String id) This method attempts to return theLanguage
with the given language code.abstract Language
getLanguage
(org.bukkit.entity.Player p) This method returns the currently selectedLanguage
of aPlayer
.abstract Collection
<Language> This method returns a fullCollection
of everyLanguage
that was found.getMessage
(String key) getMessage
(org.bukkit.entity.Player p, String key) getMessages
(org.bukkit.entity.Player p, String key) getMessages
(org.bukkit.entity.Player p, String key, UnaryOperator<String> function) org.bukkit.inventory.ItemStack
getRecipeTypeItem
(org.bukkit.entity.Player p, RecipeType recipeType) getResearchName
(org.bukkit.entity.Player p, org.bukkit.NamespacedKey key) getResourceString
(org.bukkit.entity.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
(org.bukkit.entity.Player player, String key, boolean addPrefix) void
sendMessage
(org.bukkit.command.CommandSender recipient, String key) void
sendMessage
(org.bukkit.command.CommandSender recipient, String key, boolean addPrefix) void
sendMessage
(org.bukkit.command.CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) void
sendMessage
(org.bukkit.command.CommandSender recipient, String key, UnaryOperator<String> function) void
sendMessages
(org.bukkit.command.CommandSender recipient, String key) void
sendMessages
(org.bukkit.command.CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) void
sendMessages
(org.bukkit.command.CommandSender recipient, String key, UnaryOperator<String> function) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.Keyed
getKey, key
-
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
This method returns the currently selectedLanguage
of aPlayer
.- Parameters:
p
- ThePlayer
to query- Returns:
- The
Language
that was selected by the givenPlayer
-
getDefaultLanguage
This method returns the defaultLanguage
of thisServer
- 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
@ParametersAreNonnullByDefault @Nonnull public List<String> getMessages(org.bukkit.entity.Player p, String key, UnaryOperator<String> function) -
getResearchName
@Nullable public String getResearchName(@Nonnull org.bukkit.entity.Player p, @Nonnull org.bukkit.NamespacedKey key) -
getItemGroupName
@Nullable public String getItemGroupName(@Nonnull org.bukkit.entity.Player p, @Nonnull org.bukkit.NamespacedKey key) -
getResourceString
-
getRecipeTypeItem
@Nonnull public org.bukkit.inventory.ItemStack getRecipeTypeItem(@Nonnull org.bukkit.entity.Player p, @Nonnull RecipeType recipeType) -
sendMessage
public void sendMessage(@Nonnull org.bukkit.command.CommandSender recipient, @Nonnull String key, boolean addPrefix) -
sendActionbarMessage
public void sendActionbarMessage(@Nonnull org.bukkit.entity.Player player, @Nonnull String key, boolean addPrefix) -
sendMessage
-
sendMessage
@ParametersAreNonnullByDefault public void sendMessage(org.bukkit.command.CommandSender recipient, String key, UnaryOperator<String> function) -
sendMessage
@ParametersAreNonnullByDefault public void sendMessage(org.bukkit.command.CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) -
sendMessages
-
sendMessages
@ParametersAreNonnullByDefault public void sendMessages(org.bukkit.command.CommandSender recipient, String key, boolean addPrefix, UnaryOperator<String> function) -
sendMessages
@ParametersAreNonnullByDefault public void sendMessages(org.bukkit.command.CommandSender recipient, String key, UnaryOperator<String> function) -
getTotalKeys
-
getKeys
-