[Other]: Re-introducing Configured support
MrCrayfish opened this issue ยท 9 comments
Other
Hello, I've added support back to Configured to allow players to edit the client configuration of JEI. I've not published this update yet since I am hoping you can make a few additions to the config system just to make it easier to access.
The most important change would be to have an instance of JEIClientConfigs
that can be accessed. As it stands, it's currently a local value and the only way I was able to grab an instance was through a Mixin in the constructor. I personally try to avoid using Mixins where possible and especially using them in another developers mod since it's just not good practice. I've only done it for testing the config screen.
From browsing code I'd need getters that waterfall down from:
JustEnoughItems
JustEnoughItemsClient
ClientLifecycleHandler
JeiStarter
StartData
ConfigData
(would need JEIClientConfigs
added to the record)
Other changes but not as important, is a bunch of getters to access values in your config system. I am using reflection at the moment to access them. You can find all reflection I've used a link, this should give you can idea what needs to be changed.
https://github.com/MrCrayfish/Configured/blob/1.19.X/src/main/java/com/mrcrayfish/configured/impl/jei/JeiReflection.java
Hopefully the changes can be propagated down to 1.18 too
Wow, ok nice!
Can you offer an API that I can call into in order to give you this information, instead of requiring reflection from your side?
I am likely to make changes to the configs and I would like to be able to ensure it works with Configured from my side.
I could add method you could invoke with reflection (assuming you don't want to depend on the mod in your workspace), which you could pass the JEIClientConfigs instance. I don't mind keeping the reflection that I am currently using to access what I need, however that does depend on your code not changing.
If you're going to make changes and want to ensure it continues to work with Configured, you will need to use the full API. This is the implementation of the API for your mod.
https://github.com/MrCrayfish/Configured/tree/1.19.X/src/main/java/com/mrcrayfish/configured/impl/jei
Another thing is Configured is on Fabric too.
I think the best place for this code to live is in JEI, with an optional dependency on Configured's API.
If the code is in Configured, it'll break when I change the configs. Reflection is much more fragile than an optional API dependency.
Feel free to take my implementation as a start for your mod. If you have any questions, let me know. You can contact me here or I am on Discord if you need quicker help, I am pretty active on my server.
I think this has been completed by MrCrayfish/Configured#83