Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
YACL Synced

YACL Synced

An addon for YetAnotherConfigLib with server-client config synchronization

1,299
1
Library
Management
Utility

Compatibility

Minecraft: Java Edition

1.21.x

Platforms

Fabric
NeoForge

Supported environments

Client and server

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source

Creators

Tigercrl
Tigercrl Member
KING-VITIONNOT
KING-VITIONNOT Mascot

Details

Licensed LGPL-3.0-only
Published 2 months ago
Updated 2 months ago
DescriptionChangelogVersions

YACL Synced

Enviroment Modrinth

An addon for YetAnotherConfigLib with server-client config synchronization.

This is a library mod and won't work without any mods that depend on this mod!!!

Why synced?

YACL is a config lib that helps developers create a config with beautiful config screen in Minecraft. But it doesn't support server-client config synchronization. YACL Synced is an addon for YACL that adds the feature.

For developers

Install

// build.gradle
repositories {
    maven { // Only needed for forge (YACL needs it)
        name = 'Kotlin for Forge'
        url = 'https://thedarkcolour.github.io/KotlinForForge/'
    }

    maven {
        name 'Xander Maven'
        url 'https://maven.isxander.dev/releases'
    }

    maven {
        name = "Tiger Maven"
        url = "https://maven.tigercrl.top/releases/"
    }
}

dependencies {
    modImplementation "top.tigercrl:YACLSynced-<common/fabric/neoforge>:<version>"
}

Usage

You can define a config in the same way as YACL but with SyncedConfigClassHandler.

public class CommonConfig {
    public static final ConfigClassHandler<CommonConfig> HANDLER = SyncedConfigClassHandler.createBuilder(CommonConfig.class)
            .id(YACLPlatform.rl("yacl3-test", "config"))
            .serializer(config -> GsonConfigSerializerBuilder.create(config)
                    .setPath(YACLPlatform.getConfigDir().resolve("yacl-test-v2.json5"))
                    .setJson5(true)
                    .build())
            .build();

    // ...
}

On both sides, you can use HANDLER.instance() in the same way to get the config instance.

On client side, you can also use HANDLER.localInstance() and HANDLER.remoteInstance() to get the local and remote config instances in a server.

Config mismatch detect

You can use @OptionFlags to define option flags for an autogen config

It's same as using Option.Builder.flag(...OptionFlag flag) in YACL

public class CommonConfig {
    @AutoGen(category = "test", group = "test")
    @SerialEntry(comment = "This option requires game restart")
    @OptionFlags({OptionFlags.FlagType.GAME_RESTART})
    @BooleanFlag
    public boolean myOption = true;
}

But by using @OptionFlags, YACL Synced will detect the config mismatch when joining a server and show a warning screen.

Modrinth is open source.

feat/theseus/tauri-v2@c5403db

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.