@ConvertFrom
provides the deserializer with the path and file name of a pre-existing config file from an old config library.
Supported file types:
.toml
.json
.json5
.jsonc
The below example will read an old file ./minecraft/config/example/config.json
and scrape relevant data from it by converting it to TOML first and then using that converted file as input to the deserializer. The old file will be deleted afterward.
@ConvertFrom(fileName = "config.json", folder = "example")public class ConfigImpl extends Config {public ConfigImpl {super(new Identifier.of("example", "config"));}//config stuff go here}
Heads up!
See the documentation page here 🗗