java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.localization.SlimefunLocalization
All Implemented Interfaces:
Keyed
Direct Known Subclasses:
LocalizationService

public abstract class SlimefunLocalization extends Object implements Keyed
This is an abstract parent class of LocalizationService. There is not really much more I can say besides that...
Author:
TheBusyBiscuit
See Also:
  • Constructor Details

    • SlimefunLocalization

      protected SlimefunLocalization(@Nonnull Slimefun plugin)
  • Method Details

    • getConfig

      @Nonnull protected io.github.bakedlibs.dough.config.Config getConfig()
    • save

      protected void save()
      Saves this Localization to its File
    • getChatPrefix

      @Nonnull public String getChatPrefix()
      This returns the chat prefix for our messages. Every message (unless explicitly omitted) will have this prefix prepended.
      Returns:
      The chat prefix
    • getLanguage

      @Nullable public abstract Language getLanguage(@Nonnull String id)
      This method attempts to return the Language with the given language code.
      Parameters:
      id - The language code
      Returns:
      A Language with the given id or null
    • getLanguage

      @Nullable public abstract Language getLanguage(@Nonnull Player p)
      This method returns the currently selected Language of a Player.
      Parameters:
      p - The Player to query
      Returns:
      The Language that was selected by the given Player
    • getDefaultLanguage

      @Nullable public abstract Language getDefaultLanguage()
      This method returns the default Language of this Server
      Returns:
      The default Language
    • hasLanguage

      protected abstract boolean hasLanguage(@Nonnull String id)
      This returns whether a Language with the given id exists within the project resources.
      Parameters:
      id - The Language id
      Returns:
      Whether the project contains a Language with that id
    • getLanguages

      @Nonnull public abstract Collection<Language> getLanguages()
      This method returns a full Collection of every Language that was found.
      Returns:
      A Collection that contains every installed Language
    • addLanguage

      protected abstract void addLanguage(@Nonnull String id, @Nonnull String texture)
      This method adds a new Language with the given id and texture.
      Parameters:
      id - The Language id
      texture - The texture of how this Language should be displayed
    • loadEmbeddedLanguages

      protected void loadEmbeddedLanguages()
      This will load every LanguagePreset into memory. To be precise: It performs addLanguage(String, String) for every value of LanguagePreset.
    • getMessage

      @Nonnull public String getMessage(@Nonnull String key)
    • getMessage

      @Nonnull public String getMessage(@Nonnull Player p, @Nonnull String key)
    • getDefaultMessages

      @Nonnull public List<String> getDefaultMessages(@Nonnull String key)
      Returns the Strings referring to the specified Key
      Parameters:
      key - The Key of those Messages
      Returns:
      The List this key is referring to
    • getMessages

      @Nonnull public List<String> getMessages(@Nonnull Player p, @Nonnull String key)
    • getMessages

      @ParametersAreNonnullByDefault @Nonnull public List<String> getMessages(Player p, String key, UnaryOperator<String> function)
    • getResearchName

      @Nullable public String getResearchName(@Nonnull Player p, @Nonnull NamespacedKey key)
    • getItemGroupName

      @Nullable public String getItemGroupName(@Nonnull Player p, @Nonnull NamespacedKey key)
    • getResourceString

      @Nullable public String getResourceString(@Nonnull Player p, @Nonnull String key)
    • getRecipeTypeItem

      @Nonnull public ItemStack getRecipeTypeItem(@Nonnull Player p, @Nonnull RecipeType recipeType)
    • sendMessage

      public void sendMessage(@Nonnull CommandSender recipient, @Nonnull String key, boolean addPrefix)
    • sendActionbarMessage

      public void sendActionbarMessage(@Nonnull Player player, @Nonnull String key, boolean addPrefix)
    • sendMessage

      public void sendMessage(@Nonnull CommandSender recipient, @Nonnull String key)
    • 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

      public void sendMessages(@Nonnull CommandSender recipient, @Nonnull String key)
    • 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

      @Nonnull protected Set<String> getTotalKeys(@Nonnull Language lang)
    • getKeys

      @Nonnull protected Set<String> getKeys(@Nonnull FileConfiguration... files)