Class CV2_BagConversion
java.lang.Object
valorless.havenbags.configconversion.CV2_BagConversion
Performs migration of legacy HavenBags player bag directories to the current
format. When a configuration with an outdated
config-version is
detected, this converter will:
- Update
config-versionto2and persist the change. - Scan the plugin's
/bagsdata directory. - Rename each player-named directory to the player's UUID using
UUIDFetcher.getUUID(String). Theownerlessdirectory is skipped. - Log progress, warnings, and errors during the conversion.
- This operation performs filesystem I/O and may be slow on large data sets.
- Directory renames may fail on some platforms; failures are logged and may require manual intervention.
- Invocation is intended for internal startup-time checks only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheck(valorless.valorlessutils.config.Config config) Checks the provided configuration for an outdatedconfig-versionand, if necessary, migrates bag directories from player-name based folders to UUID-based folders.
-
Constructor Details
-
CV2_BagConversion
public CV2_BagConversion()
-
-
Method Details
-
check
@DoNotCall("Internal Use Only") public static void check(@NotNull valorless.valorlessutils.config.Config config) Checks the provided configuration for an outdatedconfig-versionand, if necessary, migrates bag directories from player-name based folders to UUID-based folders. The configuration's version is upgraded to2and saved before directory migrations begin. Side effects:- Updates and saves the supplied configuration.
- Renames directories under
<dataFolder>/bagswhere applicable. - Emits log messages for progress, warnings, and errors.
- Parameters:
config- the plugin configuration holding theconfig-versionkey; must be non-null and writable
-