Class ConfigUpdater

java.lang.Object
com.ordwen.odailyquests.tools.updater.config.ConfigUpdater
All Implemented Interfaces:
IConfigUpdater
Direct Known Subclasses:
Update223to224, Update225to230, Update230to300

public abstract class ConfigUpdater extends Object implements IConfigUpdater
  • Field Details

    • configFile

      protected final File configFile
    • config

      protected final org.bukkit.configuration.file.FileConfiguration config
    • playerInterfaceFile

      protected final File playerInterfaceFile
    • playerInterface

      protected final org.bukkit.configuration.file.FileConfiguration playerInterface
  • Constructor Details

    • ConfigUpdater

      protected ConfigUpdater(ODailyQuests plugin)
  • Method Details

    • setDefaultConfigItem

      protected void setDefaultConfigItem(String path, Object value, org.bukkit.configuration.file.FileConfiguration fileConfiguration, File file, boolean replace)
      Add a default parameter in a file if it is missing.
      Parameters:
      path - path of the parameter to add
      value - default value of the parameter to add
      fileConfiguration - file configuration where add the parameter
      file - file to save the configuration
      replace - whether to replace the parameter if it already exists
    • removeConfigItem

      protected void removeConfigItem(String path, org.bukkit.configuration.file.FileConfiguration fileConfiguration, File file)
      Remove a parameter from a file.
      Parameters:
      path - path of the parameter to remove
      fileConfiguration - file configuration where remove the parameter
      file - file to save the configuration
    • parameterReplaced

      protected void parameterReplaced(String oldParameter, String newParameter)
      Notify the user that a parameter has been replaced by another.
      Parameters:
      oldParameter - old parameter
      newParameter - new parameter
    • updateVersion

      protected void updateVersion(String version)
      Update the version in the configuration file.
      Parameters:
      version - new version