Cloth Config API (Fabric/Forge/NeoForge)

Cloth Config API (Fabric/Forge/NeoForge)

169M Downloads

Request: Map entry builders

The-Fireplace opened this issue ยท 0 comments

commented

If it's not too difficult to implement, a Map entry builder would be nice to have. One of my config options is a Map<String, Integer>, and I have a feeling I'll end up with more Map options in the future. Because there are so many key-value type combinations, I wouldn't expect a bunch of functions with different types, like ConfigEntryBuilder#startStrIntMap. Instead, I feel like ConfigEntryBuilder#startMap that uses generics to determine the type would be the way to go, and just throw an exception if someone tries to use a type that isn't supported anywhere else in the config.
Alternatively, if you have a better idea for how to represent something like this in the config GUI, I'm open to suggestions.

EDIT: I realized a decent workaround for my particular scenario would be to turn it into a string list that uses a separator character to separate the key and value within each string. It's not the best solution, but it would be fairly easy to do and would work better than not showing the option.