From 5e29300768e678baf0881a60f1700cd460fae482 Mon Sep 17 00:00:00 2001 From: Tom Neumann Date: Thu, 19 Dec 2024 12:25:16 +0100 Subject: [PATCH] Modify regex to match if wrong mod/forge version is installed --- src/Analysis/Problem/Forge/ModDependencyProblem.php | 6 +++--- .../Problem/Forge/ModWrongMinecraftVersionProblem.php | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Analysis/Problem/Forge/ModDependencyProblem.php b/src/Analysis/Problem/Forge/ModDependencyProblem.php index 7b79e4fe..958dbe76 100644 --- a/src/Analysis/Problem/Forge/ModDependencyProblem.php +++ b/src/Analysis/Problem/Forge/ModDependencyProblem.php @@ -45,9 +45,9 @@ public static function getPatterns(): array { return [ '/The mod \S+ \(([^\)]+)\) requires mods \[([^\]]+)\] to be available/', - '/net\.minecraftforge\.fml\.common\.MissingModsException: Mod \S+ \((.+)\) requires (.+)/', - '/net\.minecraftforge\.fml\.ModLoadingException: Mod \§.([^\§]+)\§. requires \§.([^\§]+)\§. \§.([^ \§]+)[^\§]*\§./', - '/net\.minecraftforge\.fml\.LoadingFailedException: Loading errors encountered: \[\n(?:.*\n)*Mod \§.([^\§]+)§. requires \§.([^\§]+)\§. \§.([^ \§]+)[^\§]*\§./' + '/net\.minecraftforge\.fml\.common\.MissingModsException: Mod \S+ \((.+)\) requires (?!minecraft[,\s])(.+)/', + '/net\.minecraftforge\.fml\.ModLoadingException: Mod \§.([^\§]+)\§. requires \§.(?!minecraft\§.)([^\§]+)\§. \§.([^ \§]+)[^\§]*\§./', + '/net\.minecraftforge\.fml\.LoadingFailedException: Loading errors encountered: \[\n(?:.*\n)*Mod \§.([^\§]+)§. requires \§.(?!minecraft\§.)([^\§]+)\§. \§.([^ \§]+)[^\§]*\§./' ]; } diff --git a/src/Analysis/Problem/Forge/ModWrongMinecraftVersionProblem.php b/src/Analysis/Problem/Forge/ModWrongMinecraftVersionProblem.php index 01be8ea4..b66a50d2 100644 --- a/src/Analysis/Problem/Forge/ModWrongMinecraftVersionProblem.php +++ b/src/Analysis/Problem/Forge/ModWrongMinecraftVersionProblem.php @@ -45,7 +45,10 @@ public function getMessage(): string */ public static function getPatterns(): array { - return ['/The mod (\S+) does not wish to run in Minecraft version Minecraft ([0-9\.]+)\. You will have to remove it to play\./']; + return [ + '/The mod (\S+) does not wish to run in Minecraft version Minecraft ([0-9\.]+)\. You will have to remove it to play\./', + '/net\.minecraftforge\.fml\.ModLoadingException: Mod \§.([^\§]+)\§. requires \§.minecraft\§. \§.([^ \§]+)[^\§]*\§./', + ]; } /**