MrCrayfish / MrCrayfishDeviceMod

A Minecraft Mod that adds in electronic devices that actually work
Other
79 stars 53 forks source link

Created an Annotation for Registering Apps #131

Open AlexCouch opened 6 years ago

AlexCouch commented 6 years ago

I went ahead and created that annotation you were talking about. It was pretty simple tbh. I didn't have to changed anything in the original code, just had to provide a way for the app class to be pushed from the annotation backend to the actual registration system: ApplicationManager#registerApplication. Created a simple wrapper interface that gets implemented when the class gets hooked through the annotation. The annotation's information gets passed into said interface, IAppContainer, as well as the class instance of the app class gets stored in the interface instance as well to be passed into the original registration system.

ghost commented 6 years ago

Great idea! I hope this gets accepted

AlexCouch commented 6 years ago

Well, cray has already made his own version while I was making this. But I'm currently finalizing a plugin system for adding support for different uses of an annotation @CDMRegister for different elements of the mod/addons. Right now, applications and tasks are supported.

ghost commented 6 years ago

Ok