Interface CoreConfigAPI


public interface CoreConfigAPI
API for accessing core plugin configuration files. Provides access to settings.yml, messages.yml, sounds.yml, rewards.yml, etc. Uses the platform configuration backend internally (no YAML dependency needed in modules).
  • Method Details

    • getSettingsString

      String getSettingsString(String path)
      Get string from settings.yml
    • getSettingsString

      String getSettingsString(String path, String def)
      Get string with default from settings.yml
    • getSettingsInt

      int getSettingsInt(String path)
      Get int from settings.yml
    • getSettingsInt

      int getSettingsInt(String path, int def)
      Get int with default from settings.yml
    • getSettingsDouble

      double getSettingsDouble(String path)
      Get double from settings.yml
    • getSettingsDouble

      double getSettingsDouble(String path, double def)
      Get double with default from settings.yml
    • getSettingsBoolean

      boolean getSettingsBoolean(String path)
      Get boolean from settings.yml
    • getSettingsBoolean

      boolean getSettingsBoolean(String path, boolean def)
      Get boolean with default from settings.yml
    • getSettingsStringList

      List<String> getSettingsStringList(String path)
      Get string list from settings.yml
    • settingsContains

      boolean settingsContains(String path)
      Check if path exists in settings.yml
    • getLanguage

      String getLanguage(String key)
      Get message from messages/language file.
      Parameters:
      key - Message key (e.g., "messages.game_started")
      Returns:
      Message string
    • getLanguage

      default String getLanguage(Object player, String key)
      Get message from messages/language file for a specific platform player.

      The player parameter is intentionally typed as Object so the public API remains platform-neutral. Runtimes that support per-player languages should override this method and inspect their native player type.

      Parameters:
      player - platform player, or null to use the server default locale
      key - Message key
      Returns:
      Message string
      Since:
      3.4
    • getLanguage

      default String getLanguage(Object player, String key, Map<String,String> placeholders)
      Get player-specific message with placeholders replaced.
      Since:
      3.4
    • getLanguage

      String getLanguage(String key, Map<String,String> placeholders)
      Get message with placeholders replaced.
      Parameters:
      key - Message key
      placeholders - Map of placeholders to replace (e.g., {player} -> "Steve")
      Returns:
      Formatted message
    • getLanguageList

      List<String> getLanguageList(String key)
      Get message list (for multi-line messages).
      Parameters:
      key - List key (e.g., "scoreboard.lines")
      Returns:
      List of message lines
    • getLanguageList

      default List<String> getLanguageList(Object player, String key)
      Get player-specific message list.
      Since:
      3.4
    • getLanguageList

      default List<String> getLanguageList(Object player, String key, Map<String,String> placeholders)
      Get player-specific message list with placeholders.
      Since:
      3.4
    • getLanguageList

      List<String> getLanguageList(String key, Map<String,String> placeholders)
      Get message list with placeholders.
    • hasLenguage

      boolean hasLenguage(String key)
      Check if message key exists.
    • getSound

      String getSound(String key)
      Get sound path from sounds.yml
      Parameters:
      key - Sound key (e.g., "sounds.game_start")
      Returns:
      Sound configuration string
    • getSoundList

      List<String> getSoundList(String key)
      Get sound list (for random sounds).
    • hasSound

      boolean hasSound(String key)
      Check if sound exists.
    • getRewardsString

      String getRewardsString(String path)
      Get value from rewards.yml
    • getRewardsInt

      int getRewardsInt(String path)
      Get int from rewards.yml
    • getRewardsInt

      int getRewardsInt(String path, int def)
      Get int with default from rewards.yml
    • getRewardsStringList

      List<String> getRewardsStringList(String path)
      Get list from rewards.yml
    • rewardsContains

      boolean rewardsContains(String path)
      Check if path exists in rewards.yml
    • getStringFrom

      String getStringFrom(String fileName, String path)
      Get string from any core config file.
      Parameters:
      fileName - Config file name (e.g., "settings.yml")
      path - Config path
      Returns:
      String value
    • getStringFrom

      String getStringFrom(String fileName, String path, String def)
      Get string with default from any core config file.
    • getIntFrom

      int getIntFrom(String fileName, String path)
      Get int from any core config file.
    • getIntFrom

      int getIntFrom(String fileName, String path, int def)
      Get int with default from any core config file.
    • getDoubleFrom

      double getDoubleFrom(String fileName, String path)
      Get double from any core config file.
    • getDoubleFrom

      double getDoubleFrom(String fileName, String path, double def)
      Get double with default from any core config file.
    • getBooleanFrom

      boolean getBooleanFrom(String fileName, String path)
      Get boolean from any core config file.
    • getBooleanFrom

      boolean getBooleanFrom(String fileName, String path, boolean def)
      Get boolean with default from any core config file.
    • getStringListFrom

      List<String> getStringListFrom(String fileName, String path)
      Get string list from any core config file.
    • containsFrom

      boolean containsFrom(String fileName, String path)
      Check if path exists in any core config file.
    • reloadAll

      void reloadAll()
      Reload all core configuration files.
    • reload

      void reload(String fileName)
      Reload a specific core configuration file.