Class ConfigMigrator

java.lang.Object
com.palmergames.bukkit.config.migration.ConfigMigrator

public class ConfigMigrator extends Object
An object which manages the process of migrating towny config versions to up-to-date ones.
  • Constructor Details

    • ConfigMigrator

      public ConfigMigrator(@NotNull @NotNull CommentedConfiguration config, @NotNull @NotNull String filename, boolean earlyRun)
    • ConfigMigrator

      public ConfigMigrator(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull CommentedConfiguration config, @NotNull @NotNull String filename, @NotNull @NotNull Version lastRunVersion, boolean earlyRun)
      A ConfigMigrator constructor which another plugin can use.
      Parameters:
      plugin - Plugin object used for Logging and getting your resource folder.
      config - CommentedConfiguration config file.
      filename - String filename of your json file, ie: config-migration.json, stored in your resources folder.
      lastRunVersion - Version representing your config's version, from which Towny will determine which config migrations to apply.
      earlyRun - boolean whether this is an early run, used for gathering config values used in the MOVE and REMOVE MigrationType.
  • Method Details

    • migrate

      public void migrate()
      Migrates configuration to latest version available in the given JSON file.
    • addTownLevelProperty

      public void addTownLevelProperty(String key, String value)
    • addNationLevelProperty

      public void addNationLevelProperty(String key, String value)
    • addFarmBlock

      public void addFarmBlock(String key, String value)
    • getRunnableMigrations

      public RunnableMigrations getRunnableMigrations()