Migration
Learn how to migrate configs to OneConfig.
What is this?
OneConfig includes a system to help you migrate configs into ones OneConfig can use. For example, OneConfig has built-in support for; JSON, Vigilance, and .cfg Forge files. This is very useful if you want to seamlessly migrate your old mods to OneConfig.
All migrators implement the Migrator interface, and you can create your own as well if you want. They all work in the same way, where you pass the expected location on the player's client to the old config file, and OneConfig will do the rest, like this:
MigrationNames
Maybe you want to change the name of an old field or element in the new system. We've thought of this, and you can use our various @Annotations
to maintain the support of your old files. See an example below, using Vigilance.
And a JsonName:
Custom Migrators
To create a custom migrator, you have to implement the Migrator
interface and implement the getValue
function, and this function returns the value the field should be set to, according to the old config. For a full example see VigilanceMigrator
.
Last updated