Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move away from AutoConfig #130

Open
MattSturgeon opened this issue Dec 19, 2023 · 2 comments
Open

Move away from AutoConfig #130

MattSturgeon opened this issue Dec 19, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@MattSturgeon
Copy link
Member

MattSturgeon commented Dec 19, 2023

Background & motivation

I'm creating this issue to track & discuss a move away from AutoConfig.

AutoConfig is convenient for simple configuration because you can declare your config, add a few annotations, and watch in awe as both a frontend (GUI) and backend (save/load) is created automatically on-the-fly.

The generated GUI uses Cloth Config and the backend (in our case) is based on JanksonConfigSerializer.

It does have some limitations though:

  • Widgets are limited and (mostly) chosen automatically
    • You have some control and can register your own config entry providers/transformers, but this starts to become nearly as complex as using Cloth-Config directly.
    • EDIT: This is a non-issue if you're happy to register custom providers/transformers.
  • Dependencies aren't easy to add to config entries
  • It is difficult (effectively impossible?) to have multiple instances of a config class, since each class has one ConfigHolder which is stored in a static/global dictionary.

For an example of using Cloth Config directly, one can read their demo and browse their docs.

It's also worth noting that while still maintained and actively updated to new Minecraft versions, @shedanial is no longer actively developing Cloth Config (adding new features, reviewing PRs, etc). To quote the FAQ:

Are you still maintaining Cloth / Auto Config?
Yes, but only to fix bugs and update it to new Minecraft versions
[...] Cloth / Auto Config is unlikely to receive new features.

He even notes potential alternatives, conceding that they may not be quite as good:

Here are some notable alternatives that I think (personally), are pretty good as well.

I still think other's config screens kinda suck - shedaniel 2022

I've considered forking cloth-config or building an alternative. The goal being to break API, cleanup old code & add new features/merge PRs. That said IDK if I realistically have time to actively maintain such a project.

Other considerations

Evaluation

Hopefully in this issue we can discuss and evaluate the various options. My initial instinct is that we'll end up using Cloth Config.

@MattSturgeon

This comment was marked as resolved.

@MattSturgeon
Copy link
Member Author

Our dependency on cloth-config is one of the only things blocking us from doing snapshot builds and/or preparing releases early based on pre-releases and release candidates. We're unable to port to a new version until cloth-config has a compatible maven build published.

One solution may be to use a config system that isn't tied to any Minecraft version, and then build our own Minecraft GUI screen as a frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant