Class CV6_ConfigRestructure
java.lang.Object
valorless.havenbags.configconversion.CV6_ConfigRestructure
Performs in-place restructuring of the HavenBags configuration when an older
config-version is detected. This converter currently upgrades
configurations to version 6 by moving keys to new hierarchical
paths and removing deprecated entries.
Safety: Before any change is applied, a backup of the original configuration
file is created alongside the file using the pattern
<name>.backup-<build><ext> so administrators can revert if needed.
Usage: This class is invoked internally during plugin startup and should not be called directly from user code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheck(valorless.valorlessutils.config.Config config) Checks the provided config and, if needed, performs a one-shot migration toconfig-version = 6.
-
Constructor Details
-
CV6_ConfigRestructure
public CV6_ConfigRestructure()
-
-
Method Details
-
check
@DoNotCall("Internal Use Only") public static void check(@NotNull valorless.valorlessutils.config.Config config) Checks the provided config and, if needed, performs a one-shot migration toconfig-version = 6. The migration:- Creates a backup copy of the existing config file.
- Renames legacy flat keys to new nested keys (e.g.,
auto-save-intervaltoauto-save.interval). - Groups sound settings under
sound.*and auto-pickup settings underauto-pickup.*with structured subkeys. - Removes deprecated keys after transferring their values.
- Saves the updated configuration and logs progress.
- Parameters:
config- the configuration to migrate; must not be null
-