Skip to content

Commit

Permalink
Merge pull request #89 from aternosorg/neovanilla
Browse files Browse the repository at this point in the history
Fix detecting vanilla version on neoforge
  • Loading branch information
JulianVennen authored Oct 1, 2024
2 parents 0d965b7 + 9add53d commit 7e72b14
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 38 deletions.
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

0 comments on commit 7e72b14

Please sign in to comment.