diff --git a/lang/en.json b/lang/en.json index 34273a3a..d743c700 100644 --- a/lang/en.json +++ b/lang/en.json @@ -75,6 +75,7 @@ "server-install-different-version-solution": "Install the version '{{software-version}}' of your server software.", "plugin-api-version-problem": "The plugin '{{plugin-name}}' needs version '{{software-version}}' of your server software.", "plugin-java-version-problem": "The plugin '{{plugin-name}}' requires Java version {{java-version}} or later to run.", + "mod-java-version-problem": "The mod '{{mod-name}}' requires Java version {{java-version}} or later to run.", "change-java-version-solution": "Change your Java version to {{java-version}} or later.", "ticking-entity-problem": "The entity '{{name}}' at the location {{location}} is causing issues while ticking.", "remove-entity-solution": "Remove the entity '{{name}}' at the location {{location}}.", diff --git a/src/Analyser/FabricAnalyser.php b/src/Analyser/FabricAnalyser.php index 051c2826..e6d4a273 100644 --- a/src/Analyser/FabricAnalyser.php +++ b/src/Analyser/FabricAnalyser.php @@ -13,6 +13,7 @@ use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricMixinProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricModDependencyProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricModIncompatibleMinecraftVersionProblem; +use Aternos\Codex\Minecraft\Analysis\Problem\Fabric\FabricModJavaVersionProblem; class FabricAnalyser extends VanillaAnalyser { @@ -24,6 +25,7 @@ public function __construct() $this->addPossibleInsightClass(FabricJavaVersionInformation::class); $this->addPossibleInsightClass(FabricModDependencyProblem::class); $this->addPossibleInsightClass(FabricModIncompatibleMinecraftVersionProblem::class); + $this->addPossibleInsightClass(FabricModJavaVersionProblem::class); $this->addPossibleInsightClass(FabricMixinProblem::class); $this->addPossibleInsightClass(FabricIncompatibleModsProblem::class); $this->addPossibleInsightClass(FabricDuplicateModProblem::class); diff --git a/src/Analysis/Problem/Fabric/FabricModDependencyProblem.php b/src/Analysis/Problem/Fabric/FabricModDependencyProblem.php index 9b3a53d6..4aa7aa7f 100644 --- a/src/Analysis/Problem/Fabric/FabricModDependencyProblem.php +++ b/src/Analysis/Problem/Fabric/FabricModDependencyProblem.php @@ -35,7 +35,8 @@ public function getMessage(): string public static function getPatterns(): array { $mod = "/- Mod " . static::getModNamePattern() . "(?: [^ ]+)? "; - $dependency = " of (?:mod )?" . static::getModNamePattern("dependency") . ",/"; + // Java has its own problem, FabricModJavaVersionProblem + $dependency = " of (?:mod )?(?!" . FabricModJavaVersionProblem::JAVA_MOD . ")" . static::getModNamePattern("dependency") . ",/"; return [ 'short-error' => '/net\.fabricmc\.loader\.discovery\.ModResolutionException: Could not find required mod: ' . static::getModNamePattern() diff --git a/src/Analysis/Problem/Fabric/FabricModJavaVersionProblem.php b/src/Analysis/Problem/Fabric/FabricModJavaVersionProblem.php new file mode 100644 index 00000000..b329e48a --- /dev/null +++ b/src/Analysis/Problem/Fabric/FabricModJavaVersionProblem.php @@ -0,0 +1,90 @@ +javaVersion; + } + + /** + * @param string $javaVersion + * @return $this + */ + protected function setJavaVersion(string $javaVersion): static + { + $this->javaVersion = $javaVersion; + return $this; + } + + /** + * @inheritDoc + */ + public function getMessage(): string + { + return Translator::getInstance()->getTranslation("mod-java-version-problem", [ + "mod-name" => $this->getModName(), + "java-version" => $this->getJavaVersion() + ]); + } + + /** + * Matches a Java version requirement in the dependency list of the loader, e.g. + * - Mod 'Foo' (foo) 1.0.0 requires version 99 or later of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25! + * - Mod 'Foo' (foo) 1.0.0 requires version 99 of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25! + * + * @inheritDoc + */ + public static function getPatterns(): array + { + $mod = "/- Mod " . static::getModNamePattern() . "(?: [^ ]+)? "; + + return [ + 'minimum' => $mod . "requires version (?[^ ]+) or later of " . static::JAVA_MOD . "/", + 'specific' => $mod . "requires version (?[^ ]+) of " . static::JAVA_MOD . "/", + ]; + } + + /** + * @inheritDoc + */ + public function setMatches(array $matches, mixed $patternKey): void + { + $this->setModName($matches["mod"]); + $this->setJavaVersion($matches["version"]); + $this->addSolution(new UpdateJavaSolution($this->getJavaVersion())); + } + + /** + * @param InsightInterface $insight + * @return bool + */ + public function isEqual(InsightInterface $insight): bool + { + return $insight instanceof static + && parent::isEqual($insight) + && $this->getJavaVersion() === $insight->getJavaVersion(); + } +} diff --git a/test/data/Vanilla/Fabric/fabric-java-version-dependency-exact.json b/test/data/Vanilla/Fabric/fabric-java-version-dependency-exact.json new file mode 100644 index 00000000..c20cb1eb --- /dev/null +++ b/test/data/Vanilla/Fabric/fabric-java-version-dependency-exact.json @@ -0,0 +1,272 @@ +{ + "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:57:49] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:57:49] [main\/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:49] [main\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[18:57:49] [main\/INFO]: Mappings not present!" + } + ] + }, + { + "level": 4, + "time": null, + "prefix": "[18:57:49] [main\/WARN]:", + "lines": [ + { + "number": 4, + "content": "[18:57:49] [main\/WARN]: Mod resolution failed" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:49] [main\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[18:57:49] [main\/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED foo 1.0.0 {depends java @ [99]}, ROOT_FORCELOAD_SINGLE foo 1.0.0]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:49] [main\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[18:57:49] [main\/INFO]: Reason: [HARD_DEP foo 1.0.0 {depends java @ [99]}]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:49] [main\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[18:57:49] [main\/INFO]: SERVER environment disabled: [fabric-renderer-api-v1, fabric-model-loading-api-v1, fabric-key-mapping-api-v1, fabric-screen-api-v1, fabric-sound-api-v1, fabric-rendering-v1, fabric-renderer-indigo]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:49] [main\/INFO]:", + "lines": [ + { + "number": 8, + "content": "[18:57:49] [main\/INFO]: Fix: add [], remove [], replace [[java 25] -> add:java 99 ([[99,99]])]" + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[18:57:49] [main\/ERROR]:", + "lines": [ + { + "number": 9, + "content": "[18:57:49] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 10, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 11, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 12, + "content": "\t - Replace 'Java HotSpot(TM) 64-Bit Server VM' (java) 25 with version 99." + }, + { + "number": 13, + "content": "More details:" + }, + { + "number": 14, + "content": "\t - Mod 'Foo' (foo) 1.0.0 requires version 99 of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25!" + }, + { + "number": 15, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 16, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 17, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 18, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 19, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 20, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 21, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 22, + "content": "" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The mod 'Foo' requires Java version 99 or later to run.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:57:49] [main\/ERROR]:", + "lines": [ + { + "number": 9, + "content": "[18:57:49] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 10, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 11, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 12, + "content": "\t - Replace 'Java HotSpot(TM) 64-Bit Server VM' (java) 25 with version 99." + }, + { + "number": 13, + "content": "More details:" + }, + { + "number": 14, + "content": "\t - Mod 'Foo' (foo) 1.0.0 requires version 99 of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25!" + }, + { + "number": 15, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 16, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 17, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 18, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 19, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 20, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 21, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 22, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Change your Java version to 99 or later." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 26.3", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[18:57:49] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:57:49] [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:57:49] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:57:49] [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-java-version-dependency-exact.log b/test/data/Vanilla/Fabric/fabric-java-version-dependency-exact.log new file mode 100644 index 00000000..074a3084 --- /dev/null +++ b/test/data/Vanilla/Fabric/fabric-java-version-dependency-exact.log @@ -0,0 +1,21 @@ +Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture +[18:57:49] [main/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1 +[18:57:49] [main/INFO]: Mappings not present! +[18:57:49] [main/WARN]: Mod resolution failed +[18:57:49] [main/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED foo 1.0.0 {depends java @ [99]}, ROOT_FORCELOAD_SINGLE foo 1.0.0] +[18:57:49] [main/INFO]: Reason: [HARD_DEP foo 1.0.0 {depends java @ [99]}] +[18:57:49] [main/INFO]: SERVER environment disabled: [fabric-renderer-api-v1, fabric-model-loading-api-v1, fabric-key-mapping-api-v1, fabric-screen-api-v1, fabric-sound-api-v1, fabric-rendering-v1, fabric-renderer-indigo] +[18:57:49] [main/INFO]: Fix: add [], remove [], replace [[java 25] -> add:java 99 ([[99,99]])] +[18:57:49] [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 'Java HotSpot(TM) 64-Bit Server VM' (java) 25 with version 99. +More details: + - Mod 'Foo' (foo) 1.0.0 requires version 99 of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25! + 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/data/Vanilla/Fabric/fabric-java-version-dependency.json b/test/data/Vanilla/Fabric/fabric-java-version-dependency.json new file mode 100644 index 00000000..5347e1b7 --- /dev/null +++ b/test/data/Vanilla/Fabric/fabric-java-version-dependency.json @@ -0,0 +1,272 @@ +{ + "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:57:48] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:57:48] [main\/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:48] [main\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[18:57:48] [main\/INFO]: Mappings not present!" + } + ] + }, + { + "level": 4, + "time": null, + "prefix": "[18:57:48] [main\/WARN]:", + "lines": [ + { + "number": 4, + "content": "[18:57:48] [main\/WARN]: Mod resolution failed" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:48] [main\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[18:57:48] [main\/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED foo 1.0.0 {depends java @ [>=99]}, ROOT_FORCELOAD_SINGLE foo 1.0.0]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:48] [main\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[18:57:48] [main\/INFO]: Reason: [HARD_DEP foo 1.0.0 {depends java @ [>=99]}]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:48] [main\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[18:57:48] [main\/INFO]: SERVER environment disabled: [fabric-model-loading-api-v1, fabric-renderer-api-v1, fabric-key-mapping-api-v1, fabric-screen-api-v1, fabric-sound-api-v1, fabric-rendering-v1, fabric-renderer-indigo]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[18:57:48] [main\/INFO]:", + "lines": [ + { + "number": 8, + "content": "[18:57:48] [main\/INFO]: Fix: add [], remove [], replace [[java 25] -> add:java 99 ([[99,\u221e)])]" + } + ] + }, + { + "level": 3, + "time": null, + "prefix": "[18:57:48] [main\/ERROR]:", + "lines": [ + { + "number": 9, + "content": "[18:57:48] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 10, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 11, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 12, + "content": "\t - Replace 'Java HotSpot(TM) 64-Bit Server VM' (java) 25 with version 99 or later." + }, + { + "number": 13, + "content": "More details:" + }, + { + "number": 14, + "content": "\t - Mod 'Foo' (foo) 1.0.0 requires version 99 or later of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25!" + }, + { + "number": 15, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 16, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 17, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 18, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 19, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 20, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 21, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 22, + "content": "" + } + ] + } + ], + "analysis": { + "problems": [ + { + "message": "The mod 'Foo' requires Java version 99 or later to run.", + "counter": 1, + "entry": { + "level": 3, + "time": null, + "prefix": "[18:57:48] [main\/ERROR]:", + "lines": [ + { + "number": 9, + "content": "[18:57:48] [main\/ERROR]: Incompatible mods found!" + }, + { + "number": 10, + "content": "net.fabricmc.loader.impl.FormattedException: Some of your mods are incompatible with the game or each other!" + }, + { + "number": 11, + "content": "A potential solution has been determined, this may resolve your problem:" + }, + { + "number": 12, + "content": "\t - Replace 'Java HotSpot(TM) 64-Bit Server VM' (java) 25 with version 99 or later." + }, + { + "number": 13, + "content": "More details:" + }, + { + "number": 14, + "content": "\t - Mod 'Foo' (foo) 1.0.0 requires version 99 or later of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25!" + }, + { + "number": 15, + "content": "\tat net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:51)" + }, + { + "number": 16, + "content": "\tat net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:207)" + }, + { + "number": 17, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)" + }, + { + "number": 18, + "content": "\tat net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:66)" + }, + { + "number": 19, + "content": "\tat net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)" + }, + { + "number": 20, + "content": "\tat net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)" + }, + { + "number": 21, + "content": "\tat net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)" + }, + { + "number": 22, + "content": "" + } + ] + }, + "solutions": [ + { + "message": "Change your Java version to 99 or later." + } + ] + } + ], + "information": [ + { + "message": "Minecraft version: 26.3", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[18:57:48] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:57:48] [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:57:48] [main\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[18:57:48] [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-java-version-dependency.log b/test/data/Vanilla/Fabric/fabric-java-version-dependency.log new file mode 100644 index 00000000..4eb51cd5 --- /dev/null +++ b/test/data/Vanilla/Fabric/fabric-java-version-dependency.log @@ -0,0 +1,21 @@ +Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture +[18:57:48] [main/INFO]: Loading Minecraft 26.3 with Fabric Loader 0.20.1 +[18:57:48] [main/INFO]: Mappings not present! +[18:57:48] [main/WARN]: Mod resolution failed +[18:57:48] [main/INFO]: Immediate reason: [HARD_DEP_INCOMPATIBLE_PRESELECTED foo 1.0.0 {depends java @ [>=99]}, ROOT_FORCELOAD_SINGLE foo 1.0.0] +[18:57:48] [main/INFO]: Reason: [HARD_DEP foo 1.0.0 {depends java @ [>=99]}] +[18:57:48] [main/INFO]: SERVER environment disabled: [fabric-model-loading-api-v1, fabric-renderer-api-v1, fabric-key-mapping-api-v1, fabric-screen-api-v1, fabric-sound-api-v1, fabric-rendering-v1, fabric-renderer-indigo] +[18:57:48] [main/INFO]: Fix: add [], remove [], replace [[java 25] -> add:java 99 ([[99,∞)])] +[18:57:48] [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 'Java HotSpot(TM) 64-Bit Server VM' (java) 25 with version 99 or later. +More details: + - Mod 'Foo' (foo) 1.0.0 requires version 99 or later of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25! + 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..c31a2b49 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -1250,6 +1250,26 @@ public function test_fabric_incompatible_mods(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_fabric_java_version_dependency_exact(): void + { + $log = new TestLog('Vanilla/Fabric/fabric-java-version-dependency-exact.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + + /** + * @return void + * @throws Exception + */ + public function test_fabric_java_version_dependency(): void + { + $log = new TestLog('Vanilla/Fabric/fabric-java-version-dependency.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception @@ -2319,4 +2339,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