Class GenesisAddonConfig

java.lang.Object
studio.magemonkey.genesis.api.GenesisAddonConfig
All Implemented Interfaces:
GenesisAddonStorage

public class GenesisAddonConfig extends Object implements GenesisAddonStorage
  • Constructor Details

    • GenesisAddonConfig

      public GenesisAddonConfig(org.bukkit.plugin.Plugin plugin, String fileName)
    • GenesisAddonConfig

      public GenesisAddonConfig(org.bukkit.plugin.Plugin plugin, File file)
  • Method Details

    • save

      public boolean save()
      Save the addon config
      Specified by:
      save in interface GenesisAddonStorage
      Returns:
      saved or not
    • saveAsync

      public void saveAsync()
      Save the addon config async
      Specified by:
      saveAsync in interface GenesisAddonStorage
    • reload

      public boolean reload()
      Reload the addon config
      Returns:
      reloaded or not
    • getConfig

      public org.bukkit.configuration.file.FileConfiguration getConfig()
      Get the addon config
      Returns:
      addon config
    • getFile

      public File getFile()
      Get the config file
      Returns:
      file
    • set

      public void set(String path, Object value)
      Set a path for the config
      Specified by:
      set in interface GenesisAddonStorage
      Parameters:
      path - path
      value - value
    • getString

      public String getString(String path, String def)
      Get a string from the config
      Specified by:
      getString in interface GenesisAddonStorage
      Parameters:
      path - path
      def - default
      Returns:
      string
    • getInt

      public int getInt(String path, int def)
      Get an int from the config
      Specified by:
      getInt in interface GenesisAddonStorage
      Parameters:
      path - path
      def - default
      Returns:
      int
    • getDouble

      public double getDouble(String path, double def)
      Get a double from the config
      Specified by:
      getDouble in interface GenesisAddonStorage
      Parameters:
      path - path
      def - default
      Returns:
      double
    • getBoolean

      public boolean getBoolean(String path, boolean def)
      Get a boolean from the config
      Specified by:
      getBoolean in interface GenesisAddonStorage
      Parameters:
      path - path
      def - default
      Returns:
      boolean
    • getStringList

      public List<String> getStringList(String path)
      Get a string list from the config
      Specified by:
      getStringList in interface GenesisAddonStorage
      Parameters:
      path - path
      Returns:
      string list
    • addDefault

      public void addDefault(String path, Object value)
      Add a default path to the config
      Parameters:
      path - path
      value - value
    • containsPath

      public boolean containsPath(String key)
      Check if a config contains a path
      Specified by:
      containsPath in interface GenesisAddonStorage
      Parameters:
      key - path
      Returns:
      contains or not
    • listKeys

      public Set<String> listKeys(String section, boolean deep)
      List all keys in a section of a config
      Specified by:
      listKeys in interface GenesisAddonStorage
      Parameters:
      section - the section to check
      deep - subkeys or not
      Returns:
      list of keys
    • deleteAll

      public void deleteAll(String section)
      Delete all parts of a section
      Specified by:
      deleteAll in interface GenesisAddonStorage
      Parameters:
      section - section to delete
    • pasteContentFrom

      public boolean pasteContentFrom(GenesisAddonStorage source)
      Copy a file to a new file
      Specified by:
      pasteContentFrom in interface GenesisAddonStorage
      Parameters:
      source - the source
      Returns:
      new file