polymod icon indicating copy to clipboard operation
polymod copied to clipboard

Add support for mod dependencies

Open EliteMasterEric opened this issue 4 years ago • 3 comments

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.

EliteMasterEric avatar Sep 16 '21 19:09 EliteMasterEric

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:

  1. Resolve dependencies into the same info you'd get from a "modpack"
  2. Pass that info to the load modpack logic
  3. Load the mod itself

I think that would do the trick.

larsiusprime avatar Sep 16 '21 20:09 larsiusprime

Moved to MasterEric/polymod#11.

EliteMasterEric avatar Nov 06 '21 01:11 EliteMasterEric

Unmove.

EliteMasterEric avatar Nov 18 '21 10:11 EliteMasterEric