fabric-loader icon indicating copy to clipboard operation
fabric-loader copied to clipboard

JiJ mods that fail dependency checks whilst loading are silently dropped

Open Sollace opened this issue 6 months ago • 3 comments

Fabric Loader doesn't seem to be checking the dependencies of JiJ (nested mod jars) properly. Or rather, it checks them and omits them from loading, but it doesn't prevent the game from launching like it would if a normal mod had failed its dependencies checks, so unless the parent mod explicitly depends on all of the mods it JiJ's you end up with the game crashing due to it loading with missing libraries.

I wasn't aware of anything saying you had to depend on all your jij mods. It was my general assumption that a JiJ mod failing to load would naturally result in the main mod failing as well, or at the least it would be treated the same way as a regular mod: If it fails, show an error message and prevent the game from launching.

An example where this might occur is if the main mod ( this ) contains a JiJ dependency with stricter version requirements.

From the parent mod:

  "depends": {
    "fabricloader": "\u003e\u003d0.12.0",
    "java": "\u003e\u003d17",
    "fabric-api-base": "\u003e\u003d0.1.0",
    "fabric-lifecycle-events-v1": "\u003e\u003d0.1.0",
    "fabric-resource-loader-v0": "\u003e\u003d0.1.0",
    "kirin": "*"
  },

From the nested mod:

  "depends": {
  "minecraft": ">=1.20.2",
  "fabricloader": ">=0.15.1",
  "java": ">=17",
  "fabric-api": ">=0.91.1+1.20.2"
},

2023-12-10-1(1).log crash-2023-12-10_16.37.05-client.txt

What I'd expect is if all the candidates for a specific mod id fails, it should report that to the user and prevent the game from launching.

Sollace avatar Dec 11 '23 01:12 Sollace

Coming back a day later to add a note: I'm aware the depends block for the outer mod (minelp) has issues. x.x

It's meant to be generated by the gradle build but wasn't updated properly. I plan to fix it for the next release and beyond. I would still appreciate if fabric loader could handle this type of error condition better though. It's not a good look if the game crashes simply because the user installed fabric-api 0.89.2 instead of 0.91.1

Sollace avatar Dec 11 '23 16:12 Sollace

JiJ are optional if not required. Many mods already depend on that behavior (for example JiJ code for different versions, only the compatible one gets loaded), I assume it's intended.

I think it used to mention their errors (at least if fatal dependency errors occurred), idk if it's still the case (it could get very messy with some mods in the error screen presented to players iirc).

altrisi avatar Dec 11 '23 16:12 altrisi

JiJ are optional if not required. Many mods already depend on that behavior (for example JiJ code for different versions, only the compatible one gets loaded), I assume it's intended.

I think it used to mention their errors (at least if fatal dependency errors occurred), idk if it's still the case (it could get very messy with some mods in the error screen presented to players iirc).

Yeah, true. That's why I thought "if no candidates for the mod id succeed".

That way so long as one of the versions is able to be loaded, then it would not complain. Just if none of them pass it should probably say something.

Sollace avatar Dec 11 '23 18:12 Sollace