Consider adopting a lambda/callback-based API
asiekierka opened this issue ยท 1 comments
Minecraft Version: Probably 1.13?
The current API can require usage of @optional in some cases, which is likely to go away in 1.13.
What I propose is moving the API to use the following mechanism:
- Add an annotation for classes which are Inventory Tweaks "plugins",
- Add an interface said classes should implement which is called when Inventory Tweaks is present,
- Add lambda/interface/abstract class-based registration methods for the API logic in place of annotations.
I would like to see this API implemented in 1.12.2 as an option if possible, as it would greatly simplify my support of the mod in Charset. A good way to do it would be to move the existing annotation-based code for containers to a "default" handler if no handler for a given class was registered.