Implemented forge version switcher
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user