From e7bc409a6712ab63d9864b11812c9fae2762dc81 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Fri, 13 Nov 2026 20:34:56 +0100 Subject: [PATCH] detect more Minecraft version requirement forms in Fabric mods --- ...ModIncompatibleMinecraftVersionProblem.php | 16 + .../fabric-minecraft-version-range.json | 756 ++++++++++++++++++ .../Fabric/fabric-minecraft-version-range.log | 28 + test/tests/Logs/AutoLogsTest.php | 12 +- 4 files changed, 811 insertions(+), 1 deletion(-) create mode 100644 test/data/Vanilla/Fabric/fabric-minecraft-version-range.json create mode 100644 test/data/Vanilla/Fabric/fabric-minecraft-version-range.log diff --git a/src/Analysis/Problem/Fabric/FabricModIncompatibleMinecraftVersionProblem.php b/src/Analysis/Problem/Fabric/FabricModIncompatibleMinecraftVersionProblem.php index 6ecf0076..4da988dc 100644 --- a/src/Analysis/Problem/Fabric/FabricModIncompatibleMinecraftVersionProblem.php +++ b/src/Analysis/Problem/Fabric/FabricModIncompatibleMinecraftVersionProblem.php @@ -49,6 +49,10 @@ public function getMessage(): string * - Mod 'Example Mod' (modid) requires any version before 1.17 of 'Minecraft' (minecraft), but only the wrong version is present: 1.18.2! * - Mod 'Example Mod' (modid) requires version 1.18.2 of 'Minecraft' (minecraft), but only the wrong version is present: 1.16.5! * - Mod 'Fabric API' (fabric) 0.53.4+1.19 requires any version between 1.19-alpha.22.18.a (inclusive) and 1.20- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 1.18.2! + * - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + * - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + * - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + * (three or more versions are listed as "version 26.1, version 26.2 or version 26.3") * * @inheritDoc */ @@ -65,6 +69,9 @@ public static function getPatterns(): array 'specific' => $mod . "requires version (?[^ ]+)" . $minecraft, 'between' => $mod . "requires any version between (?[^ ]+) \((?inclusive|exclusive)\)" . " and (?[^ ]+) \((?inclusive|exclusive)\)" . $minecraft, + 'wildcard' => $mod . "requires any (?[^ ]+\.x) version" . $minecraft, + 'maximum' => $mod . "requires version (?[^ ]+) or earlier" . $minecraft, + 'list' => $mod . "requires (?version [^ ,]+(?:, version [^ ,]+)* or version [^ ]+)" . $minecraft, ]; } @@ -93,6 +100,15 @@ public function setMatches(array $matches, mixed $patternKey): void $version = "<" . $matches["version"]; break; + case 'maximum': + $version = "<=" . $matches["version"]; + break; + + case 'list': + // "version 26.1 or version 26.2" becomes "26.1 or 26.2" + $version = str_replace("version ", "", $matches["versions"]); + break; + case 'between': $minSymbol = $matches["minBound"] === "exclusive" ? ">" : ">="; $maxSymbol = $matches["maxBound"] === "exclusive" ? "<" : "<="; diff --git a/test/data/Vanilla/Fabric/fabric-minecraft-version-range.json b/test/data/Vanilla/Fabric/fabric-minecraft-version-range.json new file mode 100644 index 00000000..ddeee8fa --- /dev/null +++ b/test/data/Vanilla/Fabric/fabric-minecraft-version-range.json @@ -0,0 +1,756 @@ +{ + "id": "fabric\/server", + "name": "Fabric", + "type": "Server Log", + "version": "26.3", + "title": "Fabric 26.3 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 1, + "content": "Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:58:00] [main\/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[18:58:00] [main\/INFO]: Mappings not present!" + } + ] + }, + { + "level": 4, + "time": null, + "prefix": "[18:58:00] [main\/WARN]:", + "lines": [ + { + "number": 4, + "content": "[18:58:00] [main\/WARN]: Mod resolution failed" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[18:58:00] [main\/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED foovcany 1.0.0 {depends minecraft @ [1.x]}, ROOT_FORCELOAD_SINGLE foovcany 1.0.0]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[18:58:00] [main\/INFO]: Reason: [HARD_DEP foovcany 1.0.0 {depends minecraft @ [1.x]}, HARD_DEP foovclist 1.0.0 {depends minecraft @ [26.1 || 26.2]}, HARD_DEP foovcmax 1.0.0 {depends minecraft @ [<=26.1]}, HARD_DEP foovcmin 1.0.0 {depends minecraft @ [>=26.4]}, HARD_DEP foovcpatch 1.0.0 {depends minecraft @ [~26.1]}]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[18:58:00] [main\/INFO]: Fix: add [], remove [], replace [[minecraft 26.3] -> add:minecraft 26.1 ([[26.1,26.1]]), [foovcany 1.0.0] -> add:foovcany 1 ([(-\u221e,\u221e)]), [foovcmin 1.0.0] -> add:foovcmin 1 ([(-\u221e,\u221e)])]" + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[18:58:00] [main\/ERROR]:", + "lines": [ + { + "number": 8, + "content": "[18:58:00] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 9, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 10, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 11, + "content": "\t - Replace 'Minecraft' (minecraft) 26.3 with version 26.1." + }, + { + "number": 12, + "content": "\t - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with:" + }, + { + "number": 13, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 14, + "content": "\t - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with:" + }, + { + "number": 15, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 16, + "content": "More details:" + }, + { + "number": 17, + "content": "\t - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 18, + "content": "\t - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 19, + "content": "\t - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 20, + "content": "\t - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 21, + "content": "\t - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 22, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 23, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 24, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 25, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 26, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 27, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 28, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 29, + "content": "" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The mod 'Foo' is not compatible with the Minecraft version 26.3.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:58:00] [main\/ERROR]:", + "lines": [ + { + "number": 8, + "content": "[18:58:00] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 9, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 10, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 11, + "content": "\t - Replace 'Minecraft' (minecraft) 26.3 with version 26.1." + }, + { + "number": 12, + "content": "\t - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with:" + }, + { + "number": 13, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 14, + "content": "\t - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with:" + }, + { + "number": 15, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 16, + "content": "More details:" + }, + { + "number": 17, + "content": "\t - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 18, + "content": "\t - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 19, + "content": "\t - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 20, + "content": "\t - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 21, + "content": "\t - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 22, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 23, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 24, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 25, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 26, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 27, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 28, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 29, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Install the version '>=26.4' of your server software." + }, + { + "message": "Install a different version of the mod 'Foo'." + } + ] + }, + { + "message": "The mod 'Foo2' is not compatible with the Minecraft version 26.3.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:58:00] [main\/ERROR]:", + "lines": [ + { + "number": 8, + "content": "[18:58:00] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 9, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 10, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 11, + "content": "\t - Replace 'Minecraft' (minecraft) 26.3 with version 26.1." + }, + { + "number": 12, + "content": "\t - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with:" + }, + { + "number": 13, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 14, + "content": "\t - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with:" + }, + { + "number": 15, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 16, + "content": "More details:" + }, + { + "number": 17, + "content": "\t - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 18, + "content": "\t - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 19, + "content": "\t - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 20, + "content": "\t - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 21, + "content": "\t - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 22, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 23, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 24, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 25, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 26, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 27, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 28, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 29, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Install the version '>=26.1, <26.2-' of your server software." + }, + { + "message": "Install a different version of the mod 'Foo2'." + } + ] + }, + { + "message": "The mod 'Foo3' is not compatible with the Minecraft version 26.3.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:58:00] [main\/ERROR]:", + "lines": [ + { + "number": 8, + "content": "[18:58:00] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 9, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 10, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 11, + "content": "\t - Replace 'Minecraft' (minecraft) 26.3 with version 26.1." + }, + { + "number": 12, + "content": "\t - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with:" + }, + { + "number": 13, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 14, + "content": "\t - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with:" + }, + { + "number": 15, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 16, + "content": "More details:" + }, + { + "number": 17, + "content": "\t - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 18, + "content": "\t - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 19, + "content": "\t - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 20, + "content": "\t - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 21, + "content": "\t - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 22, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 23, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 24, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 25, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 26, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 27, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 28, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 29, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Install the version '1.x' of your server software." + }, + { + "message": "Install a different version of the mod 'Foo3'." + } + ] + }, + { + "message": "The mod 'Foo4' is not compatible with the Minecraft version 26.3.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:58:00] [main\/ERROR]:", + "lines": [ + { + "number": 8, + "content": "[18:58:00] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 9, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 10, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 11, + "content": "\t - Replace 'Minecraft' (minecraft) 26.3 with version 26.1." + }, + { + "number": 12, + "content": "\t - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with:" + }, + { + "number": 13, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 14, + "content": "\t - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with:" + }, + { + "number": 15, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 16, + "content": "More details:" + }, + { + "number": 17, + "content": "\t - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 18, + "content": "\t - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 19, + "content": "\t - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 20, + "content": "\t - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 21, + "content": "\t - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 22, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 23, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 24, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 25, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 26, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 27, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 28, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 29, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Install the version '<=26.1' of your server software." + }, + { + "message": "Install a different version of the mod 'Foo4'." + } + ] + }, + { + "message": "The mod 'Foo5' is not compatible with the Minecraft version 26.3.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:58:00] [main\/ERROR]:", + "lines": [ + { + "number": 8, + "content": "[18:58:00] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 9, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 10, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 11, + "content": "\t - Replace 'Minecraft' (minecraft) 26.3 with version 26.1." + }, + { + "number": 12, + "content": "\t - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with:" + }, + { + "number": 13, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 14, + "content": "\t - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with:" + }, + { + "number": 15, + "content": "\t\t - minecraft, version 26.1" + }, + { + "number": 16, + "content": "More details:" + }, + { + "number": 17, + "content": "\t - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 18, + "content": "\t - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 19, + "content": "\t - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 20, + "content": "\t - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 21, + "content": "\t - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3!" + }, + { + "number": 22, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 23, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 24, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 25, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 26, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 27, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 28, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 29, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Install the version '26.1 or 26.2' of your server software." + }, + { + "message": "Install a different version of the mod 'Foo5'." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 26.3", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:58:00] [main\/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1" + } + ] + }, + "label": "Minecraft version", + "value": "26.3" + }, + { + "message": "Fabric loader version: 0.20.1", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[18:58:00] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:58:00] [main\/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1" + } + ] + }, + "label": "Fabric loader version", + "value": "0.20.1" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Fabric/fabric-minecraft-version-range.log b/test/data/Vanilla/Fabric/fabric-minecraft-version-range.log new file mode 100644 index 00000000..aeb1923d --- /dev/null +++ b/test/data/Vanilla/Fabric/fabric-minecraft-version-range.log @@ -0,0 +1,28 @@ +Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture +[18:58:00] [main/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1 +[18:58:00] [main/INFO]: Mappings not present! +[18:58:00] [main/WARN]: Mod resolution failed +[18:58:00] [main/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED foovcany 1.0.0 {depends minecraft @ [1.x]}, ROOT_FORCELOAD_SINGLE foovcany 1.0.0] +[18:58:00] [main/INFO]: Reason: [HARD_DEP foovcany 1.0.0 {depends minecraft @ [1.x]}, HARD_DEP foovclist 1.0.0 {depends minecraft @ [26.1 || 26.2]}, HARD_DEP foovcmax 1.0.0 {depends minecraft @ [<=26.1]}, HARD_DEP foovcmin 1.0.0 {depends minecraft @ [>=26.4]}, HARD_DEP foovcpatch 1.0.0 {depends minecraft @ [~26.1]}] +[18:58:00] [main/INFO]: Fix: add [], remove [], replace [[minecraft 26.3] -> add:minecraft 26.1 ([[26.1,26.1]]), [foovcany 1.0.0] -> add:foovcany 1 ([(-∞,∞)]), [foovcmin 1.0.0] -> add:foovcmin 1 ([(-∞,∞)])] +[18:58:00] [main/ERROR]: Incompatible mods found! +net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other! +A potential solution has been determined, this may resolve your problem: + - Replace 'Minecraft' (minecraft) 26.3 with version 26.1. + - Replace mod 'Foo3' (foovcany) 1.0.0 with any version that is compatible with: + - minecraft, version 26.1 + - Replace mod 'Foo' (foovcmin) 1.0.0 with any version that is compatible with: + - minecraft, version 26.1 +More details: + - Mod 'Foo3' (foovcany) 1.0.0 requires any 1.x version of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + - Mod 'Foo5' (foovclist) 1.0.0 requires version 26.1 or version 26.2 of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + - Mod 'Foo4' (foovcmax) 1.0.0 requires version 26.1 or earlier of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + - Mod 'Foo' (foovcmin) 1.0.0 requires version 26.4 or later of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + - Mod 'Foo2' (foovcpatch) 1.0.0 requires any version between 26.1 (inclusive) and 26.2- (exclusive) of 'Minecraft' (minecraft), but only the wrong version is present: 26.3! + at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51) + at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207) + at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142) + at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66) + at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) + at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) + at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index ce67cfaf..16ef0972 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -1290,6 +1290,16 @@ public function test_fabric_loom_server(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_fabric_minecraft_version_range(): void + { + $log = new TestLog('Vanilla/Fabric/fabric-minecraft-version-range.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception @@ -2319,4 +2329,4 @@ public function test_velocity(): void $log = new TestLog('Velocity/velocity.log'); $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } -} +} \ No newline at end of file