CreativeCore

CreativeCore

88M Downloads

ConfigHolderDynamic#registerValue doesn't act like a folder

SrRapero720 opened this issue ยท 1 comments

commented

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

commented

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