FASTJSON2 Serializer for YACL

Quick rating

FASTJSON2 Serializer for YACL

No reviews yet

A config serializer for YetAnotherConfigLib using FASTJSON2

API/Library
Mod Loaders
Forge
NeoForge
Fabric
Quilt
Minecraft
26.2

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Required

About

Project Details

Type
Mod
License
MIT License
Latest Version
FASTJSON2 Serializer for YACL 1.0.5 Fabric 26.1
Authors
CurseForge
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

A serializer for YetAnotherConfigLib made using FASTJSON2.

 

Useage

Add as a dependancy as outlined on the version page*

// >= 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?:

// 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"));

                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 am 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

A serializer for YetAnotherConfigLib made using FASTJSON2.

Modrinth Downloads CurseForge Downloads

Useage


Add as a dependancy as outlined on the version page*
// >= 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"));

                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

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~4,000
Total Downloads
CurseForge
<1,000
Modrinth
~3,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works