
FASTJSON2 Serializer for YACL
A config serializer for YetAnotherConfigLib using FASTJSON2
About this Mod
Useage
// >= 1.21.11
public static ConfigClassHandler<Config> HANDLER = ConfigClassHandler.createBuilder(Config.class)
.id(Identifier.fromNamespaceAndPath(MOD_ID, "config"))
.serializer(config -> FastJsonConfigSerializerBuilder.create(config)
.setPath(YACLPlatform.getConfigDir().resolve("modid.json"))
.build())
.build();
// <= 1.21.10
public static ConfigClassHandler<Config> HANDLER = ConfigClassHandler.createBuilder(Config.class)
.id(ResourceLoccation.fromNamespaceAndPath(MOD_ID, "config"))
.serializer(config -> FastJsonConfigSerializerBuilder.create(config)
.setPath(YACLPlatform.getConfigDir().resolve("modid.json"))
.build())
.build();
JSON5
FastJSON2 doesn't offer any support for JSON5. If you need/want JSON5 for any reason, I would suggest continuing to use YACL's built-in Gson serializer. If you are migrating from a Json5 config back to a regular Json here is an example of how to auto migrate your user's configs from my mod Am I Up To Date?:
Example
// Replace file & field names with your mod's
public class ConfigMigration {
public static void migrate(){
try {
if (Files.exists(Path.of(YACLPlatform.getConfigDir() + "/aiutd.json5"))){
AIUTD.LOG.info("Pre-2.5.0 config found. Migrating...!");
String JSONContent = Files.readString(Path.of(YACLPlatform.getConfigDir() + "/aiutd.json5"));
JSONObject oldConfig = JSON.parseObject(JSONContent, JSONReader.Feature.AllowUnQuotedFieldNames);
Config.HANDLER.load();
Config.menuAlert = Boolean.parseBoolean(oldConfig.getString("menuAlert"));
Config.chatAlert = Boolean.parseBoolean(oldConfig.getString("chatAlert"));
Config.multiLoaderBool = Boolean.parseBoolean(oldConfig.getString("multiLoaderBool"));
Config.multiLoader = Config.LoaderEnum.valueOf(oldConfig.getString("multiLoader"));
Config.localVersion = oldConfig.getString("localVersion");
Config.modpackId = oldConfig.getString("versionAPI");
Config.multiVersion = Boolean.parseBoolean(oldConfig.getString("multiVersion"));
Config.useModpackName = Boolean.parseBoolean(oldConfig.getString("useModpackName"));
Config.modpackName = oldConfig.getString("modpackName");
Config.useCustomMessage = Boolean.parseBoolean(oldConfig.getString("useCustomMessage"));
Config.customMessage = oldConfig.getString("customMessage");
Config.linkChangelog = Boolean.parseBoolean(oldConfig.getString("linkChangelog"));
Config.ignoreColor = Config.colorEnum.valueOf(oldConfig.getString("ignoreColor"));
Config.messageColor = Config.colorEnum.valueOf(oldConfig.getString("messageColor"));
Config.changelogColor = Config.colorEnum.valueOf(oldConfig.getString("changelogColor"));
Config.HANDLER.save();
AIUTD.LOG.info("Config migrated, please double check it for accuracy!");
Files.deleteIfExists(Path.of(YACLPlatform.getConfigDir() + "/aiutd.json5"));
AIUTD.LOG.info("Old config has been deleted");
}
} catch (IOException e) {
AIUTD.LOG.error("Failed to migrate config! Please do so manually!", e);
}
try {
if (Files.exists(Path.of(YACLPlatform.getConfigDir() + "/aiutd-enduser.json5"))){
AIUTD.LOG.info("Pre-2.5.0 end user config found. Migrating...!");
String JSONContent = Files.readString(Path.of(YACLPlatform.getConfigDir() + "/aiutd-enduser.json5"));
JSONObject oldUserConfig = JSON.parseObject(JSONContent, JSONReader.Feature.AllowUnQuotedFieldNames);
EndUserConfig.USERCONFIG.load();
EndUserConfig.shouldIgnore = Boolean.parseBoolean(oldUserConfig.getString("shouldIgnore"));
Config.HANDLER.save();
AIUTD.LOG.info("End user config migrated, please double check it for accuracy!");
Files.deleteIfExists(Path.of(YACLPlatform.getConfigDir() + "/aiutd.json5"));
AIUTD.LOG.info("Old end user config has been deleted");
}
} catch (IOException e) {
AIUTD.LOG.error("Failed to migrate end user config! Please do so manually!", e);
}
}
}
FAQ
- Is this faster than using the built-in Gson serializer?
- In a word, yes. In a few more words, based on pure library performance, yes. In practice it's a bit harder to say and will likely depend on the size of the config in question. Will it make a massive difference in anything when used in a single mod? Not noticeably; if you get several using it, you may start to see something a bit more tangible.
- Why make it if it wont improve performance much?
- IDK, becuse I can? Free will and what not.
- WAST has a better score on 3/4 of the tests, why not use it?†
- Becuse I was already familiar with FastJSON and didn't need to learn anything new to make it. If I need (or want) to learn WAST one day maybe I'll make something for it then.
*Until I set up another maven
†As of June 28th, 2026
Available Versions
How to Install FASTJSON2 Serializer for YACL on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (26.3-snapshot-9).
Install Mod
Open the mod browser in the dashboard and search for "FASTJSON2 Serializer for YACL". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
26.3-snapshot-9, 26.2, 26.1.2 (+14 more)
Server-side
~ OptionalRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
FASTJSON2 Serializer for YACL server crashes on startup – what to do?
Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (26.3-snapshot-9). You can switch loaders with one click in the panel.
Is FASTJSON2 Serializer for YACL compatible with fabric and forge and neoforge and quilt?
FASTJSON2 Serializer for YACL officially supports fabric, forge, neoforge, quilt for Minecraft 26.3-snapshot-9, 26.2, 26.1.2. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with FASTJSON2 Serializer for YACL – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if FASTJSON2 Serializer for YACL consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install FASTJSON2 Serializer for YACL with just one click on your server.