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

Dependency overrides don't support certain version ranges - 'Failed to find the ModDependency 'from' to remove!

Open SplendidAlakey opened this issue 1 year ago • 10 comments

MC 1.20.x QL 0.19.0

To reproduce:

  1. Create your quilt-loader-overrides.json and fill it in like so:
{
	"schema_version": 1,
	"overrides": [
		{
			"path": "<mods>/do-a-barrel-roll-3.0.0+1.20-fabric.jar",
			"depends": {
				"remove": {
					"id": "minecraft",
					"versions": "\u003e\u003d1.20- \u003c1.20.1-"
				}
			}
		}
	]
}

I'm testing this on Do A Barrel Roll, but any mod will do 2. Install the mod you are testing and QSL/whatever other requirements it might have (DABR only needs FAPI) 3. Launch the game - crash, because the mod wants a different version of MC

The issue is reproducible whether you are removing or changing a dependency. I tested with multiple mods, that have different versions, from just 1.20 to \u003e\u003d1.20- \u003c1.20.1-.

The issue, oddly, does not happen with QSL, but you will, of course, have to change every singe module's dependency.

Logs: https://gist.github.com/SplendidAlakey/12074e792c53c30995f14966ba2be791

Edit: Replacing "versions": "\u003e\u003d1.20- \u003c1.20.1-" with "versions": "*" works for the time being.

SplendidAlakey avatar Jun 13 '23 00:06 SplendidAlakey

Never mind, I think I'm just stupid and forgot about JiJ'd mods...

SplendidAlakey avatar Jun 13 '23 00:06 SplendidAlakey

Nope, just checked. Most other mods don't even have JiJs in them. Do A Barrel Roll does, but none require MC. Sorry for a bit of spam.

SplendidAlakey avatar Jun 13 '23 00:06 SplendidAlakey

Does your log (not crash report) have any lines like the following:

[05:03:21] [main/WARN]: 'Failed to find the ModDependency 'from' to remove!
[05:03:21] [main/WARN]: 'minecraft versions [1.20- <1.20.1-, ∞)(mandatory)
[05:03:21] [main/WARN]: 'Comparison:
[05:03:21] [main/WARN]: ' [0]: on:
[05:03:21] [main/WARN]: '   id minecraft != cicada
[05:03:21] [main/WARN]: '   versions [1.20- <1.20.1-, ∞) != (-∞, ∞)
[05:03:21] [main/WARN]: '   optional? false == false
[05:03:21] [main/WARN]: '   unless matches!
[05:03:21] [main/WARN]: ' [1]: on:
[05:03:21] [main/WARN]: '   id minecraft != fabric
[05:03:21] [main/WARN]: '   versions [1.20- <1.20.1-, ∞) != (-∞, ∞)
[05:03:21] [main/WARN]: '   optional? false == false
[05:03:21] [main/WARN]: '   unless matches!
[05:03:21] [main/WARN]: ' [2]: on:
[05:03:21] [main/WARN]: '   id minecraft == minecraft
[05:03:21] [main/WARN]: '   versions [1.20- <1.20.1-, ∞) != [1.20-, 1.20.1-)
[05:03:21] [main/WARN]: '   optional? false == false
[05:03:21] [main/WARN]: '   unless matches!

AlexIIL avatar Jun 13 '23 04:06 AlexIIL

Erm, I think what you're running into is quilt's json format doesn't let you create a dependency range like this - we'll need https://github.com/QuiltMC/rfcs/pull/56 to actually be able to support overrides like this.

AlexIIL avatar Jun 13 '23 04:06 AlexIIL

Yes, there are such logs and the problem is, dependency range like this does work, because it works on QSL, it just doesn't with anything else. And even a simple "1.20" override doesn't work, e.g. Forge Config API Port for 1.20 is limited to just 1.20, neither removing nor replacing that version works.

SplendidAlakey avatar Jun 13 '23 06:06 SplendidAlakey

You can replace a dependency on a version w/o anything else by using an equals sign in your override.

LostLuma avatar Jun 13 '23 07:06 LostLuma

Doesn't seem to work for me. I just reproduced it with Forge Config API Port for 1.20:

{
	"schema_version": 1,
	"overrides": [
		{
			"path": "<mods>/ForgeConfigAPIPort-v7.0.0-1.20-Fabric.jar",
			"depends": {
				"replace": {
					"id": "minecraft",
					"versions": "1.20"
				},
				"with": {
					"id": "minecraft",
					"versions": "1.20.1"
				}
			}
		}
	]
}

Produces the same errors as before. I tried putting an equals sign in both fields - no change. This is strange, because I used to be able to do exactly that just the other day, with Capes mod, but now the overrides just refuse to take effect.

SplendidAlakey avatar Jun 13 '23 07:06 SplendidAlakey

Using this works for me (I'm on 0.19.0 if that matters):

{
	"schema_version": 1,
	"overrides": [
		{
			"path": "<mods>/ForgeConfigAPIPort-v7.0.0-1.20-Fabric.jar",
			"depends": {
				"replace": {
					"id": "minecraft",
					"versions": "=1.20"
				},
				"with": {
					"id": "minecraft",
					"versions": "=1.20.1"
				}
			}
		}
	]
}

LostLuma avatar Jun 13 '23 07:06 LostLuma

OK, your file does work, thanks! That leaves just the unusual formatting then, with multiple versions. I'm still at odds as to why it works with QSL and nothing else, but oh well.

SplendidAlakey avatar Jun 13 '23 07:06 SplendidAlakey

Actually, the QSL dependency looked like this:

		{
			"path": "<mods>/qfapi-7.0.1_qsl-6.0.1_fapi-0.83.0_mc-1.20.jar",
			"depends": {
				"remove": {
					"id": "minecraft",
					"versions": [
          "\u003e\u003d1.20-",
          "\u003c1.20.1-"
        ]
				}
			}
		}

It's slightly different, than what Do A Barrel Roll uses, in that there's a comma.

SplendidAlakey avatar Jun 13 '23 07:06 SplendidAlakey