From 9add53dab267ff452b7a8b502f4f492bc8ef9686 Mon Sep 17 00:00:00 2001 From: Julian Vennen Date: Mon, 23 Sep 2024 13:24:34 +0200 Subject: [PATCH] Fix detecting vanilla version on neoforge --- .../NeoForgeVanillaVersionInformation.php | 2 +- .../NeoForge/NeoForgeVersionInformation.php | 2 +- .../NeoForge/neoforge-1-20-4-client.json | 19 +------------------ .../NeoForge/neoforge-1-20-4-server.json | 19 +------------------ 4 files changed, 4 insertions(+), 38 deletions(-) diff --git a/src/Analysis/Information/NeoForge/NeoForgeVanillaVersionInformation.php b/src/Analysis/Information/NeoForge/NeoForgeVanillaVersionInformation.php index 5b042ad..8aabb5c 100644 --- a/src/Analysis/Information/NeoForge/NeoForgeVanillaVersionInformation.php +++ b/src/Analysis/Information/NeoForge/NeoForgeVanillaVersionInformation.php @@ -9,7 +9,7 @@ class NeoForgeVanillaVersionInformation extends VanillaVersionInformation public static function getPatterns(): array { return array_merge(parent::getPatterns(), [ - '/NeoForge mod loading, version ('. NeoForgeVersionInformation::getVersionPattern() .'), for MC ('. static::$vanillaVersionPattern . ')/', + '/NeoForge mod loading, version '. NeoForgeVersionInformation::getVersionPattern() .', for MC ('. static::$vanillaVersionPattern . ')/', "/--fml\.mcVersion, (". static::$vanillaVersionPattern .")/" ]); } diff --git a/src/Analysis/Information/NeoForge/NeoForgeVersionInformation.php b/src/Analysis/Information/NeoForge/NeoForgeVersionInformation.php index 87ac9ba..62900e8 100644 --- a/src/Analysis/Information/NeoForge/NeoForgeVersionInformation.php +++ b/src/Analysis/Information/NeoForge/NeoForgeVersionInformation.php @@ -6,7 +6,7 @@ class NeoForgeVersionInformation extends NeoForgeInformation { - protected static string $versionPattern = "[0-9\.]+(-beta)?"; + protected static string $versionPattern = "[0-9\.]+(?:-beta)?"; public function __construct() { diff --git a/test/data/Vanilla/NeoForge/neoforge-1-20-4-client.json b/test/data/Vanilla/NeoForge/neoforge-1-20-4-client.json index b94dabd..ebc5eb5 100644 --- a/test/data/Vanilla/NeoForge/neoforge-1-20-4-client.json +++ b/test/data/Vanilla/NeoForge/neoforge-1-20-4-client.json @@ -616,7 +616,7 @@ "information": [ { "message": "Minecraft version: 1.20.4", - "counter": 1, + "counter": 2, "entry": { "level": 6, "time": null, @@ -664,23 +664,6 @@ }, "label": "Java version", "value": "17.0.3" - }, - { - "message": "Minecraft version: 20.4.155-beta", - "counter": 1, - "entry": { - "level": 6, - "time": null, - "prefix": "[09Feb2024 11:42:09.061] [modloading-worker-0\/INFO] [net.neoforged.neoforge.common.NeoForgeMod\/NEOFORGE-MOD]:", - "lines": [ - { - "number": 23, - "content": "[09Feb2024 11:42:09.061] [modloading-worker-0\/INFO] [net.neoforged.neoforge.common.NeoForgeMod\/NEOFORGE-MOD]: NeoForge mod loading, version 20.4.155-beta, for MC 1.20.4 with MCP 20231207.154220" - } - ] - }, - "label": "Minecraft version", - "value": "20.4.155-beta" } ] } diff --git a/test/data/Vanilla/NeoForge/neoforge-1-20-4-server.json b/test/data/Vanilla/NeoForge/neoforge-1-20-4-server.json index 09f45a1..0028990 100644 --- a/test/data/Vanilla/NeoForge/neoforge-1-20-4-server.json +++ b/test/data/Vanilla/NeoForge/neoforge-1-20-4-server.json @@ -1342,7 +1342,7 @@ "information": [ { "message": "Minecraft version: 1.20.4", - "counter": 2, + "counter": 3, "entry": { "level": 6, "time": null, @@ -1390,23 +1390,6 @@ }, "label": "Java version", "value": "17.0.10" - }, - { - "message": "Minecraft version: 20.4.155-beta", - "counter": 1, - "entry": { - "level": 6, - "time": null, - "prefix": "[09Feb2024 12:20:44.217] [modloading-worker-0\/INFO] [net.neoforged.neoforge.common.NeoForgeMod\/NEOFORGE-MOD]:", - "lines": [ - { - "number": 10, - "content": "[09Feb2024 12:20:44.217] [modloading-worker-0\/INFO] [net.neoforged.neoforge.common.NeoForgeMod\/NEOFORGE-MOD]: NeoForge mod loading, version 20.4.155-beta, for MC 1.20.4 with MCP 20231207.154220" - } - ] - }, - "label": "Minecraft version", - "value": "20.4.155-beta" } ] }