Resourceful Config

Resourceful Config

32M Downloads

[Bug]: Config reverses the order of @Category entries

CammiePone opened this issue ยท 6 comments

commented

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):
image

Generated config jsonc (selfShapeProperties is now at the bottom, with touchShapeProperties just above it):
image

How to Reproduce?

  1. create a config
  2. added multiple categories
  3. register config
  4. 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

commented

can you show me the part where you do the @InlineCategory annotations and fields? because thats how it orders the categories and fields.

commented

im just using @Category, not @InlineCategory

commented
commented

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.

commented

alrighty! so far im liking Resourceful Config, and this is ultimately just a small issue so it's not a big deal <3

commented

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.