From 931357635e6490bf32489d25e83edbdd512c171e Mon Sep 17 00:00:00 2001 From: SaltWood_233 <105980161+SALTWOOD@users.noreply.github.com> Date: Mon, 8 Jun 2026 01:41:08 +0800 Subject: [PATCH] feat(launch): add setting to disable automatic crash analysis --- PCL.Core/App/Config.cs | 5 +++++ PCL.Core/App/Localization/Languages/en-US.xaml | 2 ++ PCL.Core/App/Localization/Languages/zh-CN.xaml | 2 ++ Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs | 1 + Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml | 2 ++ .../Pages/PageSetup/PageSetupLaunch.xaml.cs | 2 ++ 6 files changed, 14 insertions(+) diff --git a/PCL.Core/App/Config.cs b/PCL.Core/App/Config.cs index 93cb54235..81dbfcdd1 100644 --- a/PCL.Core/App/Config.cs +++ b/PCL.Core/App/Config.cs @@ -534,6 +534,11 @@ partial class HideConfigGroup /// 禁用 LWJGL Unsafe Agent。 /// [ConfigItem("LaunchAdvanceDisableLwjglUnsafeAgent", false)] public partial bool DisableLwjglUnsafeAgent { get; set; } + + /// + /// 禁用自动崩溃分析。 + /// + [ConfigItem("LaunchAdvanceDisableCrashAnalysis", false, ConfigSource.Local)] public partial bool DisableCrashAnalysis { get; set; } /// /// 渲染器。 diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index 024bbfd09..d4aecd64b 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -1669,6 +1669,8 @@ If the game window does not appear for a long time, try enabling this option. PCL will use java.exe to run the game, giving the game process standard input/output streams to avoid possible issues when logs are printed. Depending on the behavior of different Java distributions, java.exe may not support features that depend on operating system support, such as HDR colors. Therefore, do not enable this option if everything works normally. Disable LWJGL Unsafe Agent Minecraft 26.1 uses LWJGL 3.4.1, which uses the FFM API to access native memory on JDK 25+. Due to JDK optimization limitations, this may cause severe performance issues in some cases. PCL uses LWJGL Unsafe Agent to fix this issue and avoid possible performance problems. There is generally no need to disable this option, but if you encounter additional issues, you can try temporarily disabling it for troubleshooting. This feature only takes effect when the LWJGL version is 3.4.1. + Disable automatic crash analysis + When enabled, the crash analysis page will no longer automatically appear when the game crashes. The crash analysis page can still be opened manually. You can find more advanced launch options in instance settings. diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index 4b7cfe4cd..4753b1520 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -1669,6 +1669,8 @@ 如果遇到游戏窗口长时间不出现等故障可尝试启用此项,PCL 将使用 java.exe 来运行游戏,这样会让游戏进程拥有标准输入/输出流,以尽可能避免打印日志时出现问题。 取决于不同 Java 发行版的行为,java.exe 可能无法使用 HDR 颜色等依赖操作系统支持的特性。因此,如果正常使用没有问题,请勿启用该选项。 禁用 LWJGL Unsafe Agent Minecraft 26.1 使用了 LWJGL 3.4.1,LWJGL 3.4.1 使用了 FFM API 以在 JDK 25+ 上访问原生内存。由于 JDK 优化能力限制,某些情况下这会产生严重的性能问题。 PCL 会使用 LWJGL Unsafe Agent 修复这个问题,以解决可能存在的性能问题。 一般情况下没有禁用该选项的必要,但如果你遇到了额外问题,也可以尝试暂时禁用该选项以排查错误。 该功能仅会在 LWJGL 版本为 3.4.1 时生效。 + 禁用自动崩溃分析 + 启用后,游戏崩溃时将不再自动弹出崩溃分析页面。 崩溃分析页面仍可通过手动方式打开。 你还可以在实例独立设置中找到更多高级启动选项。 diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs index 8715ab3a4..7b22c43fd 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs @@ -689,6 +689,7 @@ private void Crashed() // 崩溃分析 WatcherLog(Lang.Text("Watcher.Crash.Detected")); ModMain.Hint(Lang.Text("Watcher.Crash.Hint")); + if (Config.Launch.DisableCrashAnalysis) return; ModBase.FeedbackInfo(); ModBase.RunInNewThread(() => { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml b/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml index 5e9df55da..678609cbc 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml +++ b/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml @@ -300,6 +300,8 @@ ToolTipService.Placement="Right" ToolTip="{DynamicResource Setup.Launch.Advanced.UseJavaExe.ToolTip}" /> +