Implemented forge version switcher

This commit is contained in:
Marcel Baumgartner
2023-04-26 20:13:29 +02:00
parent 154a7ab16a
commit c090105831
5 changed files with 200 additions and 5 deletions

View File

@@ -1,15 +1,23 @@
namespace Moonlight.App.Helpers;
using Logging.Net;
namespace Moonlight.App.Helpers;
public static class ParseHelper
{
public static int MinecraftToInt(string raw)
{
var versionWithoutPre = raw.Split("-")[0];
var versionWithoutPre = raw.Split("_")[0];
versionWithoutPre = versionWithoutPre.Split("-")[0];
// Fuck you 1.7.10 ;)
versionWithoutPre = versionWithoutPre.Replace("1.7.10", "1.7");
if (versionWithoutPre.Count(x => x == "."[0]) == 1)
versionWithoutPre += ".0";
return int.Parse(versionWithoutPre.Replace(".", ""));
var x = versionWithoutPre.Replace(".", "");
return int.Parse(x);
}
public static string FirstPartStartingWithNumber(string raw)