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.

28.96M
5,488
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 (optional)

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 weeks ago
DescriptionGalleryChangelogVersions

Show all versions

1
7
8
9
12

3.3.2+1.20.4 (NeoForge)

by isxander on Jan 19, 2024
Download

3.3.2+1.20.4 (Fabric)

by isxander on Jan 19, 2024
Download

YetAnotherConfigLib v3.3.2 for 1.20.4

  • Hook into the resource reloader to preload any webp/gif files that are used. This should make loading images when opening GUIs appear instantaneous.
  • Fix issue where buttons got stuck and appeared as though nothing had saved.
  • Fix an issue on NeoForged where the access widener was not transformed to an access transformer.

3.3.1+1.20.4 (NeoForge)

by isxander on Dec 7, 2023
Download

3.3.1+1.20.4 (Fabric)

by isxander on Dec 7, 2023
Download

YetAnotherConfigLib v3.3.1 for 1.20.4

  • Fix version constraint issue on Fabric

3.3.0+1.20.4 (NeoForge)

by isxander on Dec 7, 2023
Download

3.3.0+1.20.4 (Fabric)

by isxander on Dec 7, 2023
Download

YetAnotherConfigLib v3.3.0 for 1.20.4

Updates to support 1.20.4.

3.3.0-beta.1+1.20.3 (Fabric)

by isxander on Dec 5, 2023
Download

YetAnotherConfigLib v3.3.0-beta.1 for 1.20.3

Updates to support 1.20.3.

Known Issues

  • Tooltips flicker when hovering over save button.

3.3.0-beta.1+1.20.2 (Forge)

by isxander on Oct 29, 2023
Download

3.3.0-beta.1+1.20.2 (Fabric)

by isxander on Oct 29, 2023
Download

YetAnotherConfigLib 3.3.0 (Beta 1) for Minecraft 1.20.2

As you can see, a lot of the contributions to this release are from other people! That's incredible, and I'm very thankful for the community commitment to this project!

This release is a beta release, which just means that I'm not 100% sure that everything works as intended. I encourage developers to at least try this build out, and if there are no problems, you're safe to release (I hope!).

New Features

  • Added new methods to add options to groups and categories, including conditional adding and option suppliers. This increases the chances you don't need to break the huge builder chain present of YACL, so you can just keep writing, even if you need to conditionally add an option, or run some code around the option. Look for optionIf!

Changes

  • Support for the Home and End keys. (#108)
  • Add functionality for Ctrl + Left/Right (you can now jump over words, without selecting it). (#108)
  • Make the 'finding the next word' functionality more consistent with other programs. (#108)
  • Caret now pauses flickering when moving it. (#108)
  • Position the caret and the highlight area being the same height as the text. (#108)
  • Render the caret above the selection, instead of below. (#108)

Fixes

  • Fix NumberFieldController increasing their values by a power of 10 when clicking on the screen. Issue @ #103 PR @ #108
  • Fix values not updating when unfocusing a string controller. (#108)
  • Fix a bug where the caret is not rendered at the beginning of the text in string/number field controllers. (#108)
  • Fix dropdowns not being sorted correctly with capital letters. (#114)

Misc

  • Added debug JVM property -Dyacl3.debug.imageFiltering=true/false which applies experimental filtering to images to make them look better. I'd like your feedback on this!
  • You now no longer need to add additional repositories to your build.gradle. You can safely remove:
    • https://maven.quiltmc.org/repository/release/
    • https://oss.sonatype.org/content/repositories/snapshots/

Translation Updates

  • Add Dutch translation. (#121)
  • Add Italian translation. (#107)

3.2.1+1.20 (Forge)

by isxander on Sep 28, 2023
Download

3.2.1+1.20 (Fabric)

by isxander on Sep 28, 2023
Download

YetAnotherConfigLib 3.2.1 for 1.20.1-0

Changes

Config API

  • Added ConfigClassHandler#save and ConfigClassHandler#load and deprecated ConfigClassHandler#serializer.
    • The serializer should now never be called directly.
    • New load method tells serializer to load into a new instance of the config class. Only applied if the load was fully successful.
    • Deprecated ConfigSerializer#load for ConfigSerializer#loadSafely.
  • Added new parameter on SerialEntry, called required.
    • If set to true, and the entry is not found in the config, the config will be re-saved with the default value.
    • If set to false, and the entry is not found in the config, the default value will be used, but the config will not be re-saved.
  • Added new parameter on SerialEntry, called nullable.
    • If set to false, and the entry is found in the config, but the value is null, the default value will be used, and the config will be re-saved.

Bug Fixes

  • Fixed error when using the same image twice.
  • Removed debug log from WEBP and GIF image loaders.

3.2.1+1.20.2 (Forge)

by isxander on Sep 28, 2023
Download

3.2.1+1.20.2 (Fabric)

by isxander on Sep 28, 2023
Download

YetAnotherConfigLib 3.2.1 for 1.20.2

Changes

Config API

  • Added ConfigClassHandler#save and ConfigClassHandler#load and deprecated ConfigClassHandler#serializer.
    • The serializer should now never be called directly.
    • New load method tells serializer to load into a new instance of the config class. Only applied if the load was fully successful.
    • Deprecated ConfigSerializer#load for ConfigSerializer#loadSafely.
  • Added new parameter on SerialEntry, called required.
    • If set to true, and the entry is not found in the config, the config will be re-saved with the default value.
    • If set to false, and the entry is not found in the config, the default value will be used, but the config will not be re-saved.
  • Added new parameter on SerialEntry, called nullable.
    • If set to false, and the entry is found in the config, but the value is null, the default value will be used, and the config will be re-saved.

Bug Fixes

  • Fixed error when using the same image twice.
  • Removed debug log from WEBP and GIF image loaders.

3.2.0+1.20 (Forge)

by isxander on Sep 24, 2023
Download

3.2.0+1.20 (Fabric)

by isxander on Sep 24, 2023
Download

YetAnotherConfigLib 3.2 for 1.20.1 & 1.20.0

The artifact for this release is dev.isxander.yacl:yet-another-config-lib-fabric:3.2.0+1.20 (assuming Fabric)

Config API V2

Starting this update, the previous config api is now deprecated.

The new API is much more modular, and is now fully API-safe.

What does it look like?

public class MyConfig {
    public static final ConfigClassHandler<MyConfig> HANDLER = ConfigClassHandler.createBuilder(MyConfig.class)
            .id(new ResourceLocation("my_mod", "my_config")) // unique ID for your config
            .serializer(config -> GsonConfigSerializerBuilder.create(config)
                    .setPath(FabricLoader.getInstance().getConfigDir().resolve("my_config.json"))
                    .setJson5(true) // json5 support, with GSON!
                    .build()) 
            .build();
    
    @SerialEntry(comment = "optional comment!")
    public boolean myOption = true;
    
    public static void save() {
        MyConfig.HANDLER.serializer().save();
    }
    
    public static void load() {
        MyConfig.HANDLER.serializer().load();
    }
}

As you can see from the above example, it's syntactically quite similar to the old API, but with a few key differences:

  • The method of serialization has been separated from the class handler itself, allowing an API safe implementation without needing to override the class handler.
  • Supports abstract serialization.
  • Names make a lot more sense.

Auto-gen

The new API can now fully auto-generate your config into a YACL GUI with annotations. I have been very wary of this feature, since usually it can be very limiting, destroying most of the core values of the powerful YACL builder interface. However, I believe I've found a great modular way so that developers can extend the auto-gen feature with their own custom annotations, adding support for their own custom controllers!

public class MyConfig {
    public static final ConfigClassHandler<MyConfig> HANDLER = ConfigClassHandler.createBuilder(MyConfig.class)
            .id(new ResourceLocation("my_mod", "my_config")) // unique ID for your config
            .serializer(config -> GsonConfigSerializerBuilder.create(config)
                    .setPath(FabricLoader.getInstance().getConfigDir().resolve("my_config.json"))
                    .setJson5(true) // json5 support, with GSON!
                    .build()) 
            .build();
    
    @AutoGen(category = "my_category", group = "my_group")
    @Boolean(formatter = Boolean.Formatter.YES_NO, colored = true)
    public boolean myOption = true;
    
    public static Screen createScreen(Screen parent) {
        return MyConfig.HANDLER.generateGui().generateScreen(parent);
    }
}

Above is an example of auto-generating a BooleanController. Notice how the field does not require @SerialEntry. These are completely separate, and you can use both at the same time.

For the full range of auto-gen annotations, check the source!

Documentation for the new API is still a work in progress. For now, it's best to look at the following class: dev.isxander.yacl3.test.AutogenConfigTest (not available on the artifact).

Fix Sodium crash

This is bringing the off-branch hotfix 3.1.1 to the main branch.

Dropdown controllers

Crendgrim has PRed a dropdown controller! Which is in this release!

This adds two new controller builders, DropdownStringControllerBuilder and ItemControllerBuilder. The latter renders the item in the dropdown, and suggests only the items.

3.2.0+1.20.2 (Forge)

by isxander on Sep 24, 2023
Download

3.2.0+1.20.2 (Fabric)

by isxander on Sep 24, 2023
Download

YetAnotherConfigLib 3.2 for 1.20.2

The artifact for this release is dev.isxander.yacl:yet-another-config-lib-fabric:3.2.0+1.20.2 (assuming Fabric)

Config API V2

Starting this update, the previous config api is now deprecated.

The new API is much more modular, and is now fully API-safe.

What does it look like?

public class MyConfig {
    public static final ConfigClassHandler<MyConfig> HANDLER = ConfigClassHandler.createBuilder(MyConfig.class)
            .id(new ResourceLocation("my_mod", "my_config")) // unique ID for your config
            .serializer(config -> GsonConfigSerializerBuilder.create(config)
                    .setPath(FabricLoader.getInstance().getConfigDir().resolve("my_config.json"))
                    .setJson5(true) // json5 support, with GSON!
                    .build()) 
            .build();
    
    @SerialEntry(comment = "optional comment!")
    public boolean myOption = true;
    
    public static void save() {
        MyConfig.HANDLER.serializer().save();
    }
    
    public static void load() {
        MyConfig.HANDLER.serializer().load();
    }
}

As you can see from the above example, it's syntactically quite similar to the old API, but with a few key differences:

  • The method of serialization has been separated from the class handler itself, allowing an API safe implementation without needing to override the class handler.
  • Supports abstract serialization.
  • Names make a lot more sense.

Auto-gen

The new API can now fully auto-generate your config into a YACL GUI with annotations. I have been very wary of this feature, since usually it can be very limiting, destroying most of the core values of the powerful YACL builder interface. However, I believe I've found a great modular way so that developers can extend the auto-gen feature with their own custom annotations, adding support for their own custom controllers!

public class MyConfig {
    public static final ConfigClassHandler<MyConfig> HANDLER = ConfigClassHandler.createBuilder(MyConfig.class)
            .id(new ResourceLocation("my_mod", "my_config")) // unique ID for your config
            .serializer(config -> GsonConfigSerializerBuilder.create(config)
                    .setPath(FabricLoader.getInstance().getConfigDir().resolve("my_config.json"))
                    .setJson5(true) // json5 support, with GSON!
                    .build()) 
            .build();
    
    @AutoGen(category = "my_category", group = "my_group")
    @Boolean(formatter = Boolean.Formatter.YES_NO, colored = true)
    public boolean myOption = true;
    
    public static Screen createScreen(Screen parent) {
        return MyConfig.HANDLER.generateGui().generateScreen(parent);
    }
}

Above is an example of auto-generating a BooleanController. Notice how the field does not require @SerialEntry. These are completely separate, and you can use both at the same time.

For the full range of auto-gen annotations, check the source!

Documentation for the new API is still a work in progress. For now, it's best to look at the following class: dev.isxander.yacl3.test.AutogenConfigTest (not available on the artifact).

Fix Sodium crash

This is bringing the off-branch hotfix 3.1.1 to the main branch.

Dropdown controllers

Crendgrim has PRed a dropdown controller! Which is in this release!

This adds two new controller builders, DropdownStringControllerBuilder and ItemControllerBuilder. The latter renders the item in the dropdown, and suggests only the items.

3.1.1+1.19.4 (Forge)

by isxander on Aug 29, 2023
Download

3.1.1+1.19.4 (Fabric)

by isxander on Aug 29, 2023
Download

YetAnotherConfigLib v3.1.1 for 1.19.4

Rewrote gui-scope ImageRenderer API

The ImageRenderer API has been rewritten internally to use a dual-thread initialization. Before, GL calls were made on a separate thread, which silently threw errors. Sodium 0.5 introduced an option called No Error Context, which turned these warnings into complete JVM crashes.

Because of this, this rewrite was unavailable.

In the process of a huge YACL update, this commit was buried under a lot more changes that are not ready for production yet, so I decided to branch from 3.1.0 and cherrypick this commit to fix the issue.

Does it affect me as a developer?

Most likely not, declaring images through OptionDescription.Builder is unaffected as that is part of the safe API. However, if you use the ImageRenderer directly to create your own custom renderers, you will have to update your code to use the new API.

Does it affect me as a user?

Most likely, yes. Zoomify and a few other popular mods use the ImageRenderer API directly, these mods will need updating, and will fail to load the images or even crash if they are not updated.

3.1.1+1.20 (Forge)

by isxander on Aug 29, 2023
Download
1
7
8
9
12

Modrinth is open source.

main@396f737

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