From 7534f9da1f1eabe8611318bb85d18bc2039959d6 Mon Sep 17 00:00:00 2001 From: huangyu <96684075+tmdakm@users.noreply.github.com> Date: Sat, 3 Aug 2024 21:04:57 +0800 Subject: [PATCH 1/4] Read JvmArgs and LaunchArgs in ModPack --- Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb index 7dacc5dc..bb0c9bb6 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb @@ -771,6 +771,14 @@ Retry: '开启版本隔离 WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionArgumentIndie", 1) End Sub) With {.ProgressWeight = New FileInfo(FileAddress).Length / 1024 / 1024 / 6, .Block = False}) '每 6M 需要 1s + If Json("launchInfo") Is Nothing Then + Log("[ModPack] 整合包中未找到启动信息,已跳过") + Else + Dim launchInfo as JObject = Json("launchInfo) + Dim launchArgument As String = String.Join(" ", launchInfo("launchArgument")) + Dim javaArgument As String = String.Join(" ", launchInfo("javaArgument")) + WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceJvm", javaArgument) + WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceLaunch", launchArgument) '构造加载器 If Json("addons") Is Nothing Then Hint("该整合包未提供游戏版本附加信息,无法安装!", HintType.Critical) From 40e421ee3400a73a934bebb73a40d17df8bfa501 Mon Sep 17 00:00:00 2001 From: huangyu <96684075+tmdakm@users.noreply.github.com> Date: Sat, 3 Aug 2024 21:15:18 +0800 Subject: [PATCH 2/4] launchArgument to VersionAdvanceGame --- Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb index bb0c9bb6..b0e4ffe3 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb @@ -778,7 +778,7 @@ Retry: Dim launchArgument As String = String.Join(" ", launchInfo("launchArgument")) Dim javaArgument As String = String.Join(" ", launchInfo("javaArgument")) WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceJvm", javaArgument) - WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceLaunch", launchArgument) + WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceGame", launchArgument) '构造加载器 If Json("addons") Is Nothing Then Hint("该整合包未提供游戏版本附加信息,无法安装!", HintType.Critical) From 53578a8de9bf1cfbb6a8d8e54f6015738cdff8a4 Mon Sep 17 00:00:00 2001 From: huangyu <96684075+tmdakm@users.noreply.github.com> Date: Sat, 3 Aug 2024 21:46:42 +0800 Subject: [PATCH 3/4] Update Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb Co-authored-by: allMagic <116283787+allMagicNB@users.noreply.github.com> --- Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb index b0e4ffe3..0d494415 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb @@ -774,9 +774,8 @@ Retry: If Json("launchInfo") Is Nothing Then Log("[ModPack] 整合包中未找到启动信息,已跳过") Else - Dim launchInfo as JObject = Json("launchInfo) - Dim launchArgument As String = String.Join(" ", launchInfo("launchArgument")) - Dim javaArgument As String = String.Join(" ", launchInfo("javaArgument")) + Dim launchArgument As String = String.Join(" ", Json("launchInfo")("launchArgument")) + Dim javaArgument As String = String.Join(" ", Json("launchInfo")("javaArgument")) WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceJvm", javaArgument) WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceGame", launchArgument) '构造加载器 From c0f8b5c7016b5ed498b3cb7537d8d7727811ca4a Mon Sep 17 00:00:00 2001 From: huangyu <96684075+tmdakm@users.noreply.github.com> Date: Thu, 15 Aug 2024 15:07:37 +0800 Subject: [PATCH 4/4] End if --- Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb index 0d494415..a079b0b7 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.vb @@ -778,6 +778,7 @@ Retry: Dim javaArgument As String = String.Join(" ", Json("launchInfo")("javaArgument")) WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceJvm", javaArgument) WriteIni(PathMcFolder & "versions\" & VersionName & "\PCL\Setup.ini", "VersionAdvanceGame", launchArgument) + End If '构造加载器 If Json("addons") Is Nothing Then Hint("该整合包未提供游戏版本附加信息,无法安装!", HintType.Critical)