Class Language

    • Constructor Summary

      Constructors 
      Constructor Description
      Language​(org.bukkit.plugin.Plugin plugin, java.lang.String iso)  
    • Method Summary

      Modifier and Type Method Description
      static void addCategoryMessages​(org.bukkit.configuration.file.YamlConfiguration yml, java.lang.String categoryName, java.lang.String invName, java.lang.String itemName, java.util.List<java.lang.String> itemLore)
      Add required messages for a shop category to the given yml
      static void addContentMessages​(org.bukkit.configuration.file.YamlConfiguration yml, java.lang.String contentName, java.lang.String categoryName, java.lang.String itemName, java.util.List<java.lang.String> itemLore)
      Add required messages for a shop category to the given yml
      static void addDefaultMessagesCommandItems​(Language language)
      Create missing name/ lore for items: multi arena lobby, waiting, spectating
      void addDefaultStatsMsg​(org.bukkit.configuration.file.YamlConfiguration yml, java.lang.String path, java.lang.String name, java.lang.String... lore)  
      boolean exists​(java.lang.String path)
      Check if a message was set.
      static Language getDefaultLanguage()
      Get server default language.
      java.lang.String getIso()
      Get language iso code.
      static Language getLang​(java.lang.String iso)
      Get language with given info.
      static java.util.HashMap<org.bukkit.entity.Player,​Language> getLangByPlayer()  
      java.lang.String getLangName()
      Get language display name.
      static java.util.List<Language> getLanguages()
      Get loaded languages list.
      static java.util.List<java.lang.String> getList​(org.bukkit.entity.Player p, java.lang.String path)
      Get a string list in player's language.
      static java.lang.String getMsg​(org.bukkit.entity.Player p, java.lang.String path)
      Get message in player's language.
      static Language getPlayerLanguage​(org.bukkit.entity.Player p)
      Retrieve a player language.
      static java.util.List<java.lang.String> getScoreboard​(org.bukkit.entity.Player p, java.lang.String path, java.lang.String alternative)
      Get scoreboard strings.
      static boolean isLanguageExist​(java.lang.String iso)
      Check if a language exists.
      java.util.List<java.lang.String> l​(java.lang.String path)
      Get a color translated list.
      java.lang.String m​(java.lang.String path)
      Get a color translated message.
      static void saveIfNotExists​(java.lang.String path, java.lang.Object data)
      Save a value to file if not exists.
      static void setDefaultLanguage​(Language defaultLanguage)
      Change server default language.
      static void setPlayerLanguage​(org.bukkit.entity.Player p, java.lang.String iso, boolean onLogin)
      Change a player language and refresh scoreboard and custom join items.
      void setPrefix​(java.lang.String prefix)
      Set chat prefix.
      static void setupCustomStatsMessages()
      Save messages for unset stats items.
      void setupUnSetCategories()
      Create messages paths for new shop categories
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Language

        public Language​(org.bukkit.plugin.Plugin plugin,
                        java.lang.String iso)
    • Method Detail

      • setPrefix

        public void setPrefix​(java.lang.String prefix)
        Set chat prefix.
      • getScoreboard

        public static java.util.List<java.lang.String> getScoreboard​(org.bukkit.entity.Player p,
                                                                     java.lang.String path,
                                                                     java.lang.String alternative)
        Get scoreboard strings.
      • getLangName

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

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

        public static Language getPlayerLanguage​(org.bukkit.entity.Player p)
        Retrieve a player language.
      • exists

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

        public static java.util.List<java.lang.String> getList​(org.bukkit.entity.Player p,
                                                               java.lang.String path)
        Get a string list in player's language.
      • saveIfNotExists

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

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

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

        public static java.util.HashMap<org.bukkit.entity.Player,​Language> getLangByPlayer()
      • isLanguageExist

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

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

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

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

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

        public void addDefaultStatsMsg​(org.bukkit.configuration.file.YamlConfiguration yml,
                                       java.lang.String path,
                                       java.lang.String name,
                                       java.lang.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​(org.bukkit.configuration.file.YamlConfiguration yml,
                                               java.lang.String categoryName,
                                               java.lang.String invName,
                                               java.lang.String itemName,
                                               java.util.List<java.lang.String> itemLore)
        Add required messages for a shop category to the given yml
      • addContentMessages

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

        public static void setPlayerLanguage​(org.bukkit.entity.Player p,
                                             java.lang.String iso,
                                             boolean onLogin)
        Change a player language and refresh scoreboard and custom join items.
      • setDefaultLanguage

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

        public static Language getDefaultLanguage()
        Get server default language.