MrCrayfish / Configured

The easiest way to change the configuration of mods!
https://www.curseforge.com/minecraft/mc-mods/configured
Other
58 stars 44 forks source link

Update JEI config support #83

Closed mezz closed 1 year ago

mezz commented 1 year ago

I added some methods to JEI's API so that Configured can get the config information without reflection. This should make the compatibility much more stable, since JEI does not change the API much.

There are some regressions here, like Configured does not understand my record values. I added some extra support for enums in lists, but I wasn't able to make it use a selector like with regular enum values.

Despite the drawbacks, I hope this is a good clean starting point at least.

Update: I have added full support for serializing and deserializing these values in the configs.

MrCrayfish commented 1 year ago

Configured doesn't know how to convert records like ColorName into a String and vice versa. In my original implementation I added my own parser but that depended on the full codebase, since switching to API only of JEI this would no longer be possible. Anything that is not a primitive it won't understand, that's why IListType exists.

mezz commented 1 year ago

Yeah, that is a drawback of my implementation here. I noted that in the PR description as the main regression from this PR. I would like to think a bit more about how I could support that properly.

Here are some improvements that I think Configured could implement later to improve support for JEI's configs:

mezz commented 1 year ago

I may be able to expose the string serialization and deserialization in JEI's API somehow. I will try some things out and see how it looks.

mezz commented 1 year ago

I have updated this PR, and now it uses new features of JEI's API to implement IListType for List<ColorName>. 🎉

mezz commented 1 year ago

I have updated the PR to use the latest JEI version, which exposes configs much earlier. This way, players can access all the JEI configs before entering a world.

MrCrayfish commented 1 year ago

Everything checks out. Merging now. Thanks for your work into making these mods compatible again.

MrCrayfish commented 5 months ago

Hey @mezz, I am currently relicensing Configured. I want to change the mod to be under a more appropriate license of LGPLv3. I want to get your permission to change the license of your contributions under this new license. Thank you.

mezz commented 5 months ago

Hello! You have my permission to relicense my changes to Configured under LGPLv3 :+1:

MrCrayfish commented 5 months ago

Thank you!