Registering the Config
Serialization works with any types supported the following libraries:
If that's not sufficient, you can customize those serialization handlers the same way you would if you used them directly.
There are three built-in serializers for you to choose from, or you can provide your own.
// Only choose one of these!
AutoConfig.register(ModConfig.class, Toml4jConfigSerializer::new);
AutoConfig.register(ModConfig.class, GsonConfigSerializer::new);
AutoConfig.register(ModConfig.class, JanksonConfigSerializer::new);
Please read Partitioning the Config if you want the split the config into multiple files.
Last updated
Was this helpful?