|
@@ -145,18 +145,10 @@ internal static class StartCommandBuilder
|
|
|
if (version.Arguments.Jvm is not null)
|
|
|
foreach (var argument in version.Arguments.Jvm)
|
|
|
{
|
|
|
- if (argument is null)
|
|
|
- continue;
|
|
|
-
|
|
|
- var type = argument.GetType();
|
|
|
-
|
|
|
- if (argument is not JsonElement)
|
|
|
- continue;
|
|
|
-
|
|
|
- if (!(((JsonElement)argument).ValueKind == JsonValueKind.String))
|
|
|
- continue;
|
|
|
-
|
|
|
- if (((JsonElement)argument).Deserialize(typeof(string)) is not string value) continue;
|
|
|
+ if (argument is null ||
|
|
|
+ argument is not JsonElement jsonArgument ||
|
|
|
+ jsonArgument.ValueKind != JsonValueKind.String ||
|
|
|
+ jsonArgument.Deserialize(typeof(string)) is not string value) continue;
|
|
|
|
|
|
//for new forge versions (1.18, 1.19)
|
|
|
if (value.Contains("${version_name}"))
|
|
@@ -345,11 +337,8 @@ internal static class StartCommandBuilder
|
|
|
//for new forge
|
|
|
default:
|
|
|
if (argsValues[i] is not null && !argsValues[i].Contains("${"))
|
|
|
- {
|
|
|
returnString.Append($" {args[i]} {argsValues[i]}");
|
|
|
- }
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
return returnString.ToString();
|