Class AddonConfig

java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration
net.guizhanss.guizhanlib.slimefun.addon.AddonConfig
All Implemented Interfaces:
org.bukkit.configuration.Configuration, org.bukkit.configuration.ConfigurationSection

public final class AddonConfig extends org.bukkit.configuration.file.YamlConfiguration
Represent an extended YamlConfiguration from addon.

Modified from InfinityLib.

  • Field Summary

    Fields inherited from class org.bukkit.configuration.file.YamlConfiguration

    BLANK_CONFIG, COMMENT_PREFIX

    Fields inherited from class org.bukkit.configuration.MemoryConfiguration

    options

    Fields inherited from class org.bukkit.configuration.MemorySection

    map
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the missing keys from the default config to the users config
    protected String
     
    org.bukkit.configuration.file.YamlConfiguration
     
    double
    getDouble(String path, double min, double max)
     
    double
    getDouble(String path, double min, double defaultVal, double max)
     
    int
    getInt(String path, int min, int max)
     
    int
    getInt(String path, int min, int defaultVal, int max)
     
    void
     
    void
    Removes unused/old keys from the users config
    void
     
    void
    save(File file)
     
     
    void
    setDefault(String path, Object obj)
     

    Methods inherited from class org.bukkit.configuration.file.YamlConfiguration

    loadConfiguration, loadConfiguration, loadFromString, options

    Methods inherited from class org.bukkit.configuration.file.FileConfiguration

    load, load, load, save

    Methods inherited from class org.bukkit.configuration.MemoryConfiguration

    addDefault, addDefaults, addDefaults, getParent, setDefaults

    Methods inherited from class org.bukkit.configuration.MemorySection

    contains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, setComments, setInlineComments, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.configuration.ConfigurationSection

    contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getComponent, getComponent, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRichMessage, getRichMessage, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, set, setComments, setComponent, setInlineComments, setRichMessage
  • Constructor Details

    • AddonConfig

      public AddonConfig(@Nonnull String path)
    • AddonConfig

      @ParametersAreNonnullByDefault public AddonConfig(AbstractAddon addon, String path)
  • Method Details

    • getInt

      public int getInt(@Nonnull String path, int min, int max)
    • getInt

      public int getInt(@Nonnull String path, int min, int defaultVal, int max)
    • getDouble

      public double getDouble(@Nonnull String path, double min, double max)
    • getDouble

      public double getDouble(@Nonnull String path, double min, double defaultVal, double max)
    • removeUnusedKeys

      public void removeUnusedKeys()
      Removes unused/old keys from the users config
    • addMissingKeys

      public void addMissingKeys()
      Adds the missing keys from the default config to the users config
    • setDefault

      public void setDefault(@Nonnull String path, @Nullable Object obj)
    • save

      public void save()
    • save

      public void save(@Nonnull File file) throws IOException
      Overrides:
      save in class org.bukkit.configuration.file.FileConfiguration
      Throws:
      IOException
    • reload

      public void reload()
    • getDefaults

      @Nonnull public org.bukkit.configuration.file.YamlConfiguration getDefaults()
      Specified by:
      getDefaults in interface org.bukkit.configuration.Configuration
      Overrides:
      getDefaults in class org.bukkit.configuration.MemoryConfiguration
    • buildHeader

      @Nonnull protected String buildHeader()
      Overrides:
      buildHeader in class org.bukkit.configuration.file.FileConfiguration
    • saveToString

      @Nonnull public String saveToString()
      Overrides:
      saveToString in class org.bukkit.configuration.file.YamlConfiguration