Class ConfigManager

java.lang.Object
com.andrei1058.bedwars.api.configuration.ConfigManager
Direct Known Subclasses:
Language

public class ConfigManager extends Object
  • Constructor Details

    • ConfigManager

      public ConfigManager(org.bukkit.plugin.Plugin plugin, String name, String dir)
      Create a new configuration file.
      Parameters:
      plugin - config owner.
      name - config name. Do not include .yml in it.
  • Method Details

    • reload

      public void reload()
      Reload configuration.
    • stringLocationArenaFormat

      public String stringLocationArenaFormat(org.bukkit.Location loc)
      Convert a location to an arena location syntax
    • stringLocationConfigFormat

      public String stringLocationConfigFormat(org.bukkit.Location loc)
      Convert a location to a string for general use Use stringLocationArenaFormat(Location) for arena locations
    • saveConfigLoc

      public void saveConfigLoc(String path, org.bukkit.Location loc)
      Save a general location to the config. Use saveArenaLoc(String, Location) for arena locations
    • saveArenaLoc

      public void saveArenaLoc(String path, org.bukkit.Location loc)
      Save a location for arena use
    • getConfigLoc

      public org.bukkit.Location getConfigLoc(String path)
      Get a general location Use getArenaLoc(String) for locations stored using saveArenaLoc(String, Location)
    • getArenaLoc

      public org.bukkit.Location getArenaLoc(String path)
      Get a location for arena use Use getConfigLoc(String) (String)} for locations stored using saveConfigLoc(String, Location) (String, Location)}
    • convertStringToArenaLocation

      public org.bukkit.Location convertStringToArenaLocation(String string)
      Convert string to arena location syntax
    • getArenaLocations

      public List<org.bukkit.Location> getArenaLocations(String path)
      Get list of arena locations at given path
    • set

      public void set(String path, Object value)
      Set data to config
    • getYml

      public org.bukkit.configuration.file.YamlConfiguration getYml()
      Get yml instance
    • save

      public void save()
      Save config changes to file
    • getList

      public List<String> getList(String path)
      Get list of strings at given path
      Returns:
      a list of string with colors translated
    • getBoolean

      public boolean getBoolean(String path)
      Get boolean at given path
    • getInt

      public int getInt(String path)
      Get Integer at given path
    • getDouble

      public double getDouble(String path)
    • getString

      public String getString(String path)
      Get string at given path
    • isFirstTime

      public boolean isFirstTime()
      Check if the config file was created for the first time Can be used to add default values
    • compareArenaLoc

      public boolean compareArenaLoc(org.bukkit.Location l1, org.bukkit.Location l2)
      Compare two arena locations Return true if same location
    • getName

      public String getName()
      Get config name
    • setName

      public void setName(String name)
      Change internal name.