Convert IModuleProvider to a capability-based system
josephcsible opened this issue ยท 5 comments
RFTools screens currently use an interface-based system (IModuleProvider) to allow other mods to add modules. When I tried to add this in CyclopsMC/IntegratedDynamics#334, this presented a problem. Integrated Dynamics uses a separate mod (https://github.com/CyclopsMC/IntegratedDynamics-Compat) to add all cross-mod compatibility, and it's not possible to add interfaces this way. Can a capability-based system for this be added?
Integrated Dynamics is really 2 mods: IntegratedDynamics proper, and IntegratedDynamics-Compat. IntegratedDynamics proper doesn't pull in all of the mods that it has mod compatibility for; that's IntegratedDynamics-Compat's job. But you can't make an item implement an interface without editing its code, so -Compat can't add the IModuleProvider interface. If it were a capability, it would be possible to add from any mod.
Ok I get it. I'm personally not a fan of the capability based API system but if that's the only way. At the moment I don't have time for this and also not sure exactly how to make such an API but I will accept a PR for this
Okay, I'll make a PR. Should I leave the old interface system in for backwards compatibility, or can I replace it entirely with the capability system?