CreativeMD / CreativeCore

Required by AmbientSounds, ItemPhysic, LittleTiles, ...
GNU Lesser General Public License v3.0
56 stars 35 forks source link

ConfigHolderDynamic#registerValue doesn't act like a folder #234

Closed SrRapero720 closed 1 month ago

SrRapero720 commented 1 month ago

trying to stack a configValue onto other Config value just to have a "category order" on the config files. I founded using registerValue doesn't make a new ConfigHolderDynamic containing all the parsed values

On paper doing this should place Whitelist options inside Permissions options. image

but instead it get stacked linearly image

This is because the return value of registerValue is itself instead of make a new holder image

CreativeMD commented 1 month ago

registerValue cannot be used for a folder, or let's say it shouldn't. The way you create the config should not be done in your case. This is only there for dynamic configurations which might change when changing a resourcepack for example. It is used by AmbientSounds. I think in your case it is better to create classes which have the config in them (nested stuff also works). You can take a look at the config of ItemPhysic to get an idea: https://github.com/CreativeMD/ItemPhysic/blob/1.20/src/main/java/team/creative/itemphysic/ItemPhysicConfig.java