Skip to content

Improvement: Config System#298

Draft
beanbag44 wants to merge 46 commits into
1.21.11from
improvement/config-system
Draft

Improvement: Config System#298
beanbag44 wants to merge 46 commits into
1.21.11from
improvement/config-system

Conversation

@beanbag44
Copy link
Copy Markdown
Member

@beanbag44 beanbag44 commented Jun 2, 2026

Replaces the old group system with annotation-based grouping and adds a second type. The old group name was used for tabs, now, @group(groups) is used for actual drop-down groups, and @tab(tabs) is used for tabs (the old group functionality). With the more strongly integrated layering, groups and tabs are now serialized, allowing duplicate setting names within the same config as long as they are separated by a layer.

The old system had a patchy style of grouping settings; however, now it is supported directly inside the Config's, with systems in place to ensure they're easy to create and use. Previously, you had to include a prefix parameter in every SettingGroup and apply it to the start of each settings name to ensure if you had two groups of the same kind, the names wouldnt conflict. You also had to use a helper .index() call at the end of every setting so that when using the ConfigEditor api, it could distinguish the settings inside and out of any given group. Now, SettingGroup has been renamed to SettingBlock to avoid confusion with the grouping system, and none of these problems are present.

Lots of the issues previously encountered were fixed mainly by the annotations enforcing use of reflections for gathering setting metadata. This is what helped make SettingBlock integration much easier; however, it tightened the restrictions as to where you can register settings from. All settings must be class-level values or variables to be found via reflections, and subsequently registered.

Removes all SettingCore child classes and moves the logic into Setting child classes instead. Im not sure why i initially put the logic in the SettingCore classes as it made handling listeners and the automation configs a lot more difficult, and in some cases outright causing unfixable problems.

Moves from Gson to Jackson as it has support for updating already initialized objects rather than creating new instances. This allows us to keep our singleton-based configs while moving away from serialization and deserialization inside the classes themselves. This means the Jsonable interface is also removed. Alongside the Jackson migration, we also have a custom Serializers and Deserializers class that searches the objects supertypes for the closest relevant (de)serializer, e.g., so we dont have to write them for each module. These serializers extend FallbackSerializer or FallbackDeserializer. The standard serializers still extend the regular Serializer and Deserializer classes.

Configs now only save modified settings. Settings have an open isModified value so settings like collection settings can check size and match elements to see if anythings changed

Left to do: Nullability in settings, (good for optional baritone dep), and arbitrary data storing in configs for when something needs to be saved, but doesnt need the overhead of a setting.

# Conflicts:
#	src/main/kotlin/com/lambda/util/EntityUtils.kt
#	src/main/kotlin/com/lambda/util/InputUtils.kt
# Conflicts:
#	src/main/kotlin/com/lambda/Lambda.kt
#	src/main/kotlin/com/lambda/config/codecs/BindCodec.kt
# Conflicts:
#	src/main/kotlin/com/lambda/module/modules/client/ModuleNotifier.kt
…giving the right reset / undo commands when clicked
beanbag44 added 15 commits May 21, 2026 16:06
# Conflicts:
#	src/main/kotlin/com/lambda/graphics/mc/renderer/ChunkedRenderer.kt
#	src/main/kotlin/com/lambda/module/modules/debug/BlockTest.kt
#	src/main/kotlin/com/lambda/module/modules/debug/RenderTest.kt
#	src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt
#	src/main/kotlin/com/lambda/module/modules/render/Nametags.kt
#	src/main/kotlin/com/lambda/module/modules/render/Search.kt
#	src/main/kotlin/com/lambda/module/modules/render/Tracers.kt
# Conflicts:
#	src/main/kotlin/com/lambda/graphics/mc/renderer/ChunkedRenderer.kt
#	src/main/kotlin/com/lambda/module/modules/render/Search.kt
@beanbag44 beanbag44 added feature Suggests or adds a new feature refactor labels Jun 2, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Kanban Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Suggests or adds a new feature refactor

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant