[Bug]: Config reverses the order of @Category entries
CammiePone opened this issue ยท 6 comments
Bug Description
When a config contains multiple @Category
entries, the json generates them in the reverse order they're made within the config class.
Config class (selfShapeProperties is the very first category, with touchShapeProperties being the second):
Generated config jsonc (selfShapeProperties is now at the bottom, with touchShapeProperties just above it):
How to Reproduce?
- create a config
- added multiple categories
- register config
- run game to generate the config file
Expected Behavior
@Category
entries would be generated in the same order they're created, like @ConfigEntry
entries are
Version
2.1.1
Mod Loader Version
Quilt Loader 1.20.1 - 0.20.2
Mod Loader
No response
Logs or additional context
No response
can you show me the part where you do the @InlineCategory annotations and fields? because thats how it orders the categories and fields.
here, did a quick push so i could show the whole config class:
https://github.com/Up-Mods/Arcanus-Continuum/blob/7cf61f2d00a8c45926e4556b4f0eaac1fefc84fc/src/main/java/dev/cammiescorner/arcanuscontinuum/ArcanusConfig.java
and here's what the full config json looks like:
https://pastebin.com/PZ5WmVC2
oh okay, I do just pull the declared classes in java so ill have to see how the jvm is doing that to see if this is something that is common across all of them.
alrighty! so far im liking Resourceful Config, and this is ultimately just a small issue so it's not a big deal <3
Okay for now as a temporary fix in the 1.20.1 versions I have added the sortOrder parameter for category annotation.
In 1.20.4 categories will be defined in the config annotation itself as to define the order without trying to infer as JDKs do not have a standard they have to follow for such a situation so on different jvms it can be in different orders.