Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detecting vanilla version on neoforge #89

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 .")/"
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
19 changes: 1 addition & 18 deletions test/data/Vanilla/NeoForge/neoforge-1-20-4-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@
"information": [
{
"message": "Minecraft version: 1.20.4",
"counter": 1,
"counter": 2,
"entry": {
"level": 6,
"time": null,
Expand Down Expand Up @@ -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"
}
]
}
Expand Down
19 changes: 1 addition & 18 deletions test/data/Vanilla/NeoForge/neoforge-1-20-4-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@
"information": [
{
"message": "Minecraft version: 1.20.4",
"counter": 2,
"counter": 3,
"entry": {
"level": 6,
"time": null,
Expand Down Expand Up @@ -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"
}
]
}
Expand Down
Loading