Add support for mod dependencies
Some mods may rely on another mod being installed in order to work.
Add an attribute to _polymod_meta.json that looks like this:
"dependencies": [
"foo",
"bar:1.*.*"
],
When the mod attempts to load, Polymod will check if a mod with the ID foo, and a mod with the id bar and a version matching 1.*.* are installed. If they are not, the mod will fail to load.
We sort of have this already in the form of modpacks, but I assume that's not sufficient to meet this requirement? In terms of implementation this could re-use most of that code.
Effectively it would create a mod pack on the spot out of the dependencies and then load the main mod itself, as well as the "virtual mod pack." The question then becomes which of these should be loaded first (presumably the dependencies, then the mod itself, so it can overwrite anything "below" itself).
So I think it would look like:
- Resolve dependencies into the same info you'd get from a "modpack"
- Pass that info to the load modpack logic
- Load the mod itself
I think that would do the trick.
Moved to MasterEric/polymod#11.
Unmove.