Class CV7_ConfigRestructure
config.yml in-place to config-version = 7.
This converter is executed during plugin startup when an older
config-version is detected. It performs a small restructure of a
couple of legacy flat sections by converting them into structured sections.
Currently affected settings:
hardcore-bagsis converted into a section containing:enabled,unbound,bound,unused, andused.protect-bagsis converted into a section containing:enabled,unbound,bound,unused, andused.
Safety: Before any changes are written, a backup of the
original configuration file is created next to the file using the pattern
<name>.backup-<build><ext> (where build is taken from the
plugin version string). If the backup fails, the migration is aborted to
avoid destructive changes.
Note: Some setters are deferred by one tick using a Bukkit task to avoid potential timing issues with the underlying configuration IO. The migration still completes during startup.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheck(valorless.valorlessutils.config.Config config) Checks the given configuration and performs a one-time migration toconfig-version = 7when required.
-
Constructor Details
-
CV7_ConfigRestructure
public CV7_ConfigRestructure()
-
-
Method Details
-
check
@DoNotCall("Internal Use Only") public static void check(@NotNull valorless.valorlessutils.config.Config config) Checks the given configuration and performs a one-time migration toconfig-version = 7when required.The migration will:
- Create/update a backup copy of the existing config file.
- Set
config-versionto7. - If
hardcore-bagsexists, remove the legacy value and create the newhardcore-bags.*keys with defaults. - If
protect-bagsexists, remove the legacy value and create the newprotect-bags.*keys with defaults. - Save the updated configuration.
This method is intended for internal use during startup only and should not be called directly.
- Parameters:
config- configuration wrapper to migrate
-