Class Language

java.lang.Object
com.andrei1058.bedwars.api.configuration.ConfigManager
com.andrei1058.bedwars.api.language.Language

public class Language extends ConfigManager
  • Constructor Details

    • Language

      public Language(org.bukkit.plugin.Plugin plugin, String iso)
  • Method Details

    • setPrefix

      public void setPrefix(String prefix)
      Set chat prefix.
    • setPrefixStatic

      public void setPrefixStatic(String prefix)
    • getScoreboard

      public static List<String> getScoreboard(org.bukkit.entity.Player player, String path, String alternative)
      Get scoreboard strings.
    • getLangName

      public String getLangName()
      Get language display name.
    • getMsg

      public static String getMsg(org.bukkit.entity.Player player, String path)
      Get message in player's language.
    • getPlayerLanguage

      public static Language getPlayerLanguage(@NotNull @NotNull org.bukkit.entity.Player player)
      Retrieve a player language.
    • getPlayerLanguage

      public static Language getPlayerLanguage(UUID p)
    • exists

      public boolean exists(String path)
      Check if a message was set.
    • getList

      public static List<String> getList(@NotNull @NotNull org.bukkit.entity.Player player, String path)
      Get a string list in player's language.
    • relocate

      public void relocate(String from, String to)
    • saveIfNotExists

      public static void saveIfNotExists(String path, Object data)
      Save a value to file if not exists.
    • m

      public String m(String path)
      Get a color translated message.
    • l

      public List<String> l(String path)
      Get a color translated list.
    • getLangByPlayer

      public static HashMap<UUID,Language> getLangByPlayer()
    • isLanguageExist

      public static boolean isLanguageExist(String iso)
      Check if a language exists.
    • getLang

      public static Language getLang(String iso)
      Get language with given info.
      Returns:
      null if you could not find.
    • getIso

      public String getIso()
      Get language iso code.
    • getLanguages

      public static List<Language> getLanguages()
      Get loaded languages list.
    • setupCustomStatsMessages

      public static void setupCustomStatsMessages()
      Save messages for unset stats items.
    • addDefaultStatsMsg

      public void addDefaultStatsMsg(@NotNull @NotNull org.bukkit.configuration.file.YamlConfiguration yml, String path, String name, String... lore)
    • addDefaultMessagesCommandItems

      public static void addDefaultMessagesCommandItems(Language language)
      Create missing name/ lore for items: multi arena lobby, waiting, spectating
    • setupUnSetCategories

      public void setupUnSetCategories()
      Create messages paths for new shop categories
    • addCategoryMessages

      public static void addCategoryMessages(@NotNull @NotNull org.bukkit.configuration.file.YamlConfiguration yml, String categoryName, String invName, String itemName, List<String> itemLore)
      Add required messages for a shop category to the given yml
    • addContentMessages

      public static void addContentMessages(@NotNull @NotNull org.bukkit.configuration.file.YamlConfiguration yml, String contentName, String categoryName, String itemName, List<String> itemLore)
      Add required messages for a shop category to the given yml
    • setPlayerLanguage

      public static boolean setPlayerLanguage(UUID uuid, String iso)
      Change a player language and refresh scoreboard and custom join items.
    • getCountDownTitle

      public static String @NotNull [] getCountDownTitle(@NotNull @NotNull Language playerLang, int second)
    • setDefaultLanguage

      public static void setDefaultLanguage(Language defaultLanguage)
      Change server default language.
    • getDefaultLanguage

      public static Language getDefaultLanguage()
      Get server default language.