CardinalPGM
CardinalPGM copied to clipboard
Modules Rewrite
The name might be slightly misleading, I am not suggesting rewriting all modules, but rather the base module system. I wrote this system about 9 months ago, and it has done a pretty decent job of doing what has been needed. Although we have hit a bit of a brick wall with it, and I see it being somewhat limiting and difficult to work with as more modules get added.
Things to be implemented:
-
Intelligent module detection Currently, we have a hard-coded list of modules, and a list of module builders. I'm thinking of having an annotation,
@Module
, which will be included on classes that are modules. Any plugin can contain modules though this method, allowing for the same expansion abilities as we have currently. More details will follow in a PR, although I'm referencing this to get an idea as to how to scan the classpath. -
Scratch
ModuleLoadTime
I've had enough of it. While it served an important purpose, I think a better system can be implemented, based on dependencies rather than arbitrary times. In addition, modules should be able to specify to load before another module. - Construction stages Rather than constructing modules in one pass, have a series of steps for modules to interact, and possibly fail. Detecting failing modules well ahead of time can allow the plugin to report clean error messages and respond appropriately, enhancing the user experience for a typical user who doesn't want to spend time figuring out what is wrong.
- Support loading modules before and after the world. Some modules require being loaded before the world, and currently, Cardinal has no way to do this.
- Rethink the current Module and Builder system This is one place where I am really open for suggestions, should we keep it largely the same or is there a better option at this point?
- Integrated error checking We should go above and beyond the basics of functionality here, provide an integrated system for modules to report errors. Modules should optionally be able to be polled for errors and warnings.
These are just my initial thoughts thrown down, I really want to hear feedback from everyone, I want Modules to be as easy to work with as possible, and be as flexible as possible. Is there anything major I am missing here? A feature you want for writing modules that I didn't mention? I want to be able to reuse as much of the already written modules as possible, but obviously many will need major revisions if not a rewrite, which most of them probably deserve anyways.