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
YetAnotherConfigLib (YACL)

YetAnotherConfigLib (YACL)

A builder-based configuration library for Minecraft.

26.34M
5,207
Library
Management
Utility

Compatibility

Minecraft: Java Edition

1.21.x
1.20.x
1.19.x

Platforms

Fabric
Forge
NeoForge
Quilt

Supported environments

Client-side
Server-side
Client and server

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source Visit wiki Join Discord server
Donate on Patreon

Creators

isxander
isxander Owner

Details

Licensed LGPL-3.0-or-later
Published 2 years ago
Updated 2 months ago
DescriptionGalleryChangelogVersions
All versionsYetAnotherConfigLib 3.5.0 for MC 1.21

YetAnotherConfigLib 3.5.0 for MC 1.21

Download
Report

Changelog

YetAnotherConfigLib 3.5.0

This build supports the following versions:

  • Fabric 1.20.1
  • Fabric 1.20.4
  • Fabric 1.20.6 (also supports 1.20.5)
  • Fabric 1.21
  • NeoForge 1.20.6 (also supports 1.20.5)
  • NeoForge 1.20.4
  • MinecraftForge 1.20.1

Experimental Codec Config

This update brings a new experimental config API that utilises Mojang's Codec for (de)serialization.

public class CodecConfig extends JsonFileCodecConfig/*or*/CodecConfig {
    public static final CodecConfig INSTANCE = new CodecConfig();

    public final ConfigEntry<Integer> myInt =
            register("my_int", 0, Codec.INT);

    public final ReadonlyConfigEntry<InnerCodecConfig> myInnerConfig =
            register("my_inner_config", InnerCodecConfig.INSTANCE);

    public CodecConfig() {
        super(path);
    }
    
    void test() {
        loadFromFile(); // load like this
        saveToFile(); // save like this
        
        // or if you just extend CodecConfig instead of JsonFileConfig:
        JsonElement element = null;
        this.decode(element, JsonOps.INSTANCE); // load
        DataResult<JsonElement> encoded = this.encodeStart(JsonOps.INSTANCE); // save
    }
}

or in Kotlin...

object CodecConfig : JsonFileCodecConfig(path) {
    val myInt by register<Int>(0, Codec.INT)
    
    val myInnerConfig by register(InnerCodecConfig)
    
    fun test() {
        loadFromFile()
        saveToFile()
        
        // blah blah blah
    }
}

Rewritten Kotlin DSL

Completely rewrote the Kotlin DSL!

YetAnotherConfigLib("namespace") {
    val category by categories.registering {
        val option by rootOptions.registering<Int> {
            controller = slider(range = 5..10)
            binding(::thisProp, default)
            
            val otherOption by categories["category"]["group"].futureRef<Boolean>()
            otherOption.onReady { it.setAvailable(false) }
        }
        
        // translation key is generated automagically
        val label by rootOptions.registeringLabel
        
        val group by groups.registering {
            val otherOption = options.register<Boolean>("otherOption") {
                controller = tickBox()
            }
        }
    }
}

Changes

  • Fix dropdown controllers erroneously showing their dropdown - Crendgrim
  • Make cancel/reset and undo buttons public for accessing
  • Add compatibility for 1.21

Dependencies

dependency-iconFabric APIrequired

Files

YetAnotherConfigLib-3.5.0+1.21-fabric.jar(1.1 MiB) Primary
Download

Metadata

Release channel

Release

Version number

3.5.0+1.21-fabric

Loaders

Fabric

Game versions

1.21–1.21.1

Downloads

3052957

Publication date

June 13, 2024 at 4:13 PM

Publisher

isxander

isxander

Owner

Version ID

Modrinth is open source.

main@81b0922

© 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.