Class ConfigMigrator
java.lang.Object
com.palmergames.bukkit.config.migration.ConfigMigrator
An object which manages the process of migrating towny config versions to
up-to-date ones.
-
Constructor Summary
ConstructorDescriptionConfigMigrator
(@NotNull CommentedConfiguration config, @NotNull String filename, boolean earlyRun) ConfigMigrator
(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull CommentedConfiguration config, @NotNull String filename, @NotNull Version lastRunVersion, boolean earlyRun) A ConfigMigrator constructor which another plugin can use. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFarmBlock
(String key, String value) void
addNationLevelProperty
(String key, String value) void
addTownLevelProperty
(String key, String value) void
migrate()
Migrates configuration to latest version available in the given JSON file.
-
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
-
addNationLevelProperty
-
addFarmBlock
-
getRunnableMigrations
-