Skip to content

fix(wrapper): 更换老旧的 RetroWrapper 到 LegacyFix#3159

Open
zkitefly wants to merge 5 commits into
PCL-Community:devfrom
zkitefly:betacraftuk/legacyfix-new
Open

fix(wrapper): 更换老旧的 RetroWrapper 到 LegacyFix#3159
zkitefly wants to merge 5 commits into
PCL-Community:devfrom
zkitefly:betacraftuk/legacyfix-new

Conversation

@zkitefly

@zkitefly zkitefly commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

RetroWrapper 太久没更新了,用 LegacyFix 更有保障

文件版本:https://github.com/betacraftuk/legacyfix/actions/runs/25253333468

#3155 不小心签错名了,为了美观我选择新建一个新分支(

Summary by Sourcery

将过时的 RetroWrapper 集成替换为 LegacyFix,用于启动旧版本的 Minecraft。

新功能:

  • 支持使用 LegacyFix Java 代理和捆绑的 JAR 启动旧版 Minecraft。

改进:

  • 简化判断何时需要旧版封装支持的逻辑,并在 LegacyFix 的使用上增加日志记录。
  • 将配置开关和每实例设置从基于 RetroWrapper 的键更新为基于 LegacyFix 的键,包括相应的 UI 绑定和本地化条目。
Original summary in English

Summary by Sourcery

Replace the outdated RetroWrapper integration with LegacyFix for launching older Minecraft versions.

New Features:

  • Support launching legacy Minecraft versions using the LegacyFix Java agent and bundled JAR.

Enhancements:

  • Simplify the logic that decides when legacy wrapper support is needed and add logging around LegacyFix usage.
  • Update configuration flags and per-instance settings from RetroWrapper-specific keys to LegacyFix-specific ones, including corresponding UI bindings and localization entries.

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: M PR 大小评估:中型 labels Jun 16, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

审阅者指南

用 LegacyFix 替换过时的基于 RetroWrapper 的兼容层,并将其接入到启动参数构造、资源解压以及配置开关中,同时更新相关的 UI 绑定和本地化键。

Minecraft 启动中 LegacyFix 集成的时序图

sequenceDiagram
    participant McLaunchArgumentsJvmNew
    participant McLaunchArgumentsReplace
    participant McLaunchNeedsLegacyFix
    participant Config
    participant ModBase

    McLaunchArgumentsJvmNew->>McLaunchNeedsLegacyFix: McLaunchNeedsLegacyFix(instance)
    McLaunchNeedsLegacyFix->>Config: Launch.DisableLF
    McLaunchNeedsLegacyFix->>Config: Instance.DisableLF[mc.PathInstance]
    McLaunchNeedsLegacyFix-->>McLaunchArgumentsJvmNew: needsLegacyFix

    alt needsLegacyFix
        McLaunchArgumentsJvmNew->>ModBase: Log("[Launch] 启用 LegacyFix")
        McLaunchArgumentsJvmNew->>McLaunchArgumentsJvmNew: dataList.Add(-javaagent:"legacyfix.jar")
        McLaunchArgumentsJvmNew->>McLaunchArgumentsJvmNew: [instance.releaseTime < 2011-05-25] dataList.Add(-Djava.util.Arrays.useLegacyMergeSort=true)
    end

    McLaunchArgumentsReplace->>McLaunchNeedsLegacyFix: McLaunchNeedsLegacyFix(instance)
    McLaunchNeedsLegacyFix-->>McLaunchArgumentsReplace: needsLegacyFix

    alt needsLegacyFix
        McLaunchArgumentsReplace->>ModBase: GetResourceStream("Resources/legacyfix.jar")
        McLaunchArgumentsReplace->>ModBase: WriteFile("legacyfix.jar", stream)
        McLaunchArgumentsReplace->>McLaunchArgumentsReplace: cpStrings.Add("legacyfix.jar")
    else LegacyFix disabled
        McLaunchNeedsLegacyFix->>ModBase: Log("[Launch] LegacyFix 已被禁用")
    end
Loading

文件级变更

Change Details Files
在 Minecraft 启动流水线中,用 LegacyFix 替换 RetroWrapper 的检测与集成逻辑。
  • 将 RetroWrapper 的门控辅助方法重命名为面向 LegacyFix 的方法,并修改其逻辑以遵循新的 DisableLF 标志,同时使用简单的 releaseTime 阈值检查。
  • 通过添加指向 legacyfix.jar 的 -javaagent 引用,将 JVM 参数中的 RetroWrapper 替换为 LegacyFix,并为非常旧的版本按条件添加旧式归并排序系统属性。
  • 从旧版本游戏的启动参数中移除 RetroWrapper tweakClass 注入。
  • 将包装器的解压路径和资源从 RetroWrapper.jar 改为 legacyfix.jar,并更新相关的日志消息。
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs
引入 LegacyFix 专用的配置开关,并将 UI 绑定从旧的 RetroWrapper 开关重接到这些新开关上。
  • 将启动层级和每版本的 DisableRW 配置项重命名为 DisableLF,保持相同的默认值与配置来源。
  • 更新读取或设置旧 RetroWrapper 相关配置标签的代码路径,使其使用新的 LegacyFix 键,覆盖全局启动设置和每实例的覆盖项。
  • 调整 XAML 绑定及其后台代码,使之匹配新的 LegacyFix 配置键。
  • 更新本地化资源,在 UI 中出现的地方,将名称从 RetroWrapper 更新为 LegacyFix。
PCL.Core/App/Config.cs
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml

技巧与命令

与 Sourcery 交互

  • 触发新的审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 在某条审阅评论下回复,请求 Sourcery 从该评论创建 issue。你也可以在审阅评论下回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题中任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在指定位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 来在任意时间(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成审阅者指南。
  • 一键解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。适用于你已经处理完所有评论且不想再看到它们的情况。
  • 取消所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss,即可取消所有现有的 Sourcery 审阅。特别适合你希望从一次全新的审阅开始时使用——别忘了再评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

访问你的 控制面板 来:

  • 启用或禁用审阅功能,例如 Sourcery 生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Replace the outdated RetroWrapper-based compatibility layer with LegacyFix, wiring it into launch-time argument construction, resource extraction, and configuration toggles, plus updating related UI bindings and localization keys.

Sequence diagram for LegacyFix integration in Minecraft launch

sequenceDiagram
    participant McLaunchArgumentsJvmNew
    participant McLaunchArgumentsReplace
    participant McLaunchNeedsLegacyFix
    participant Config
    participant ModBase

    McLaunchArgumentsJvmNew->>McLaunchNeedsLegacyFix: McLaunchNeedsLegacyFix(instance)
    McLaunchNeedsLegacyFix->>Config: Launch.DisableLF
    McLaunchNeedsLegacyFix->>Config: Instance.DisableLF[mc.PathInstance]
    McLaunchNeedsLegacyFix-->>McLaunchArgumentsJvmNew: needsLegacyFix

    alt needsLegacyFix
        McLaunchArgumentsJvmNew->>ModBase: Log("[Launch] 启用 LegacyFix")
        McLaunchArgumentsJvmNew->>McLaunchArgumentsJvmNew: dataList.Add(-javaagent:"legacyfix.jar")
        McLaunchArgumentsJvmNew->>McLaunchArgumentsJvmNew: [instance.releaseTime < 2011-05-25] dataList.Add(-Djava.util.Arrays.useLegacyMergeSort=true)
    end

    McLaunchArgumentsReplace->>McLaunchNeedsLegacyFix: McLaunchNeedsLegacyFix(instance)
    McLaunchNeedsLegacyFix-->>McLaunchArgumentsReplace: needsLegacyFix

    alt needsLegacyFix
        McLaunchArgumentsReplace->>ModBase: GetResourceStream("Resources/legacyfix.jar")
        McLaunchArgumentsReplace->>ModBase: WriteFile("legacyfix.jar", stream)
        McLaunchArgumentsReplace->>McLaunchArgumentsReplace: cpStrings.Add("legacyfix.jar")
    else LegacyFix disabled
        McLaunchNeedsLegacyFix->>ModBase: Log("[Launch] LegacyFix 已被禁用")
    end
Loading

File-Level Changes

Change Details Files
Replace RetroWrapper detection and integration with LegacyFix in the Minecraft launch pipeline.
  • Rename the RetroWrapper gating helper to a LegacyFix-focused method and change its logic to respect new DisableLF flags and use a simple releaseTime threshold check.
  • Swap RetroWrapper JVM arguments for LegacyFix by adding a -javaagent reference to legacyfix.jar and conditionally adding a legacy merge-sort system property for very old versions.
  • Remove RetroWrapper tweakClass injection from old-game launch arguments.
  • Change the wrapper extraction path and resource from RetroWrapper.jar to legacyfix.jar, and update associated logging messages.
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs
Introduce LegacyFix-specific configuration flags and rewire UI bindings from the old RetroWrapper flags.
  • Rename Launch-level and per-version DisableRW config items to DisableLF, keeping the same defaults and config sources.
  • Update code paths that read or set the old RetroWrapper-related config tags to use the new LegacyFix keys for both global launch settings and per-instance overrides.
  • Adjust XAML bindings and backing code-behind to match the new LegacyFix config keys.
  • Update localization resources to reflect the naming change from RetroWrapper to LegacyFix where surfaced in the UI.
PCL.Core/App/Config.cs
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并留下了一些整体性的反馈:

  • McLaunchNeedsLegacyFix 中,即使 needs 为 false 也会打印日志 [Launch] 启用 LegacyFix,这可能会造成误导;建议只在实际需要 LegacyFix 时再记录这条日志,并在不需要时单独记录另一条日志。
  • 配置项的键从 LaunchAdvanceDisableRW / VersionAdvanceDisableRW 改成了 LaunchAdvanceDisableLF / VersionAdvanceDisableLF;如果你想保留现有用户的设置,就应该保持持久化用的键名不变,只重命名属性名,或者新增一条迁移路径。
供 AI Agent 使用的提示
Please address the comments from this code review:

## Overall Comments
-`McLaunchNeedsLegacyFix` 中,即使 `needs` 为 false 也会打印日志 `[Launch] 启用 LegacyFix`,这可能会造成误导;建议只在实际需要 LegacyFix 时再记录这条日志,并在不需要时单独记录另一条日志。
- 配置项的键从 `LaunchAdvanceDisableRW` / `VersionAdvanceDisableRW` 改成了 `LaunchAdvanceDisableLF` / `VersionAdvanceDisableLF`;如果你想保留现有用户的设置,就应该保持持久化用的键名不变,只重命名属性名,或者新增一条迁移路径。

## Individual Comments

### Comment 1
<location path="PCL.Core/App/Config.cs" line_range="520-523" />
<code_context>
+        /// 禁用 LegacyFix
         /// </summary>
-        [ConfigItem<bool>("LaunchAdvanceDisableRW", false, ConfigSource.Local)] public partial bool DisableRw { get; set; }
+        [ConfigItem<bool>("LaunchAdvanceDisableLF", false, ConfigSource.Local)] public partial bool DisableLF { get; set; }

         /// <summary>
</code_context>
<issue_to_address>
**issue (bug_risk):** 将配置键从 `...DisableRW` 重命名为 `...DisableLF` 可能会破坏现有用户的设置。

这些键之前是以 `LaunchAdvanceDisableRW` / `VersionAdvanceDisableRW` 的形式持久化的,现在改成 `...DisableLF` 后,之前禁用了 RetroWrapper 的用户在升级后会丢失该偏好设置,并且可能在不知情的情况下被启用 LegacyFix。如果你需要保持向后兼容,要么保留原始的键名,只重命名属性名,要么添加迁移逻辑,从旧键读取值并映射到新键。
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得我们的 Review 有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的 Review。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In McLaunchNeedsLegacyFix, the log message [Launch] 启用 LegacyFix is emitted even when needs is false, which can be misleading; consider logging only when LegacyFix is actually required and perhaps adding a separate log when it is not needed.
  • The config item keys were changed from LaunchAdvanceDisableRW / VersionAdvanceDisableRW to LaunchAdvanceDisableLF / VersionAdvanceDisableLF; if you want to preserve existing user settings, keep the persisted key strings the same and only rename the property names or add a migration path.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `McLaunchNeedsLegacyFix`, the log message `[Launch] 启用 LegacyFix` is emitted even when `needs` is false, which can be misleading; consider logging only when LegacyFix is actually required and perhaps adding a separate log when it is not needed.
- The config item keys were changed from `LaunchAdvanceDisableRW` / `VersionAdvanceDisableRW` to `LaunchAdvanceDisableLF` / `VersionAdvanceDisableLF`; if you want to preserve existing user settings, keep the persisted key strings the same and only rename the property names or add a migration path.

## Individual Comments

### Comment 1
<location path="PCL.Core/App/Config.cs" line_range="520-523" />
<code_context>
+        /// 禁用 LegacyFix
         /// </summary>
-        [ConfigItem<bool>("LaunchAdvanceDisableRW", false, ConfigSource.Local)] public partial bool DisableRw { get; set; }
+        [ConfigItem<bool>("LaunchAdvanceDisableLF", false, ConfigSource.Local)] public partial bool DisableLF { get; set; }

         /// <summary>
</code_context>
<issue_to_address>
**issue (bug_risk):** Renaming the config keys from `...DisableRW` to `...DisableLF` may break existing user settings.

These keys were previously persisted as `LaunchAdvanceDisableRW` / `VersionAdvanceDisableRW`, and changing them to `...DisableLF` means existing users who disabled RetroWrapper will lose that preference after upgrade and may unexpectedly have LegacyFix enabled. If you need backward compatibility, either keep the original key names and only rename the property, or add a migration that reads the old keys and maps their values to the new ones.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread PCL.Core/App/Config.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9960a5a0b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread PCL.Core/App/Config.cs
/// 禁用 LegacyFix
/// </summary>
[ConfigItem<bool>("LaunchAdvanceDisableRW", false, ConfigSource.Local)] public partial bool DisableRw { get; set; }
[ConfigItem<bool>("LaunchAdvanceDisableLF", false, ConfigSource.Local)] public partial bool DisableLF { get; set; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Complete the DisableRw rename

This rename removes the generated DisableRw members, but PageSetupLaunch.xaml.cs and PageInstanceSetup.xaml.cs still reference Config.Launch.DisableRw / Config.Instance.DisableRw and CheckAdvanceDisableRW. After source generation and XAML name generation, those symbols no longer exist, so the project will not compile until the remaining code-behind references are updated to the new DisableLF/CheckAdvanceDisableLF names.

Useful? React with 👍 / 👎.

if (McLaunchNeedsLegacyFix(instance))
{
var legacyFixPath = Path.Combine(ModBase.pathPure, "legacyfix.jar");
dataList.Add("-javaagent:\"" + legacyFixPath + "\"");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the LegacyFix agent to the old JVM path

This -javaagent is only added in McLaunchArgumentsJvmNew(), but the 1.5.x-and-below versions this feature targets are routed through McLaunchArgumentsJvmOld() when their JSON only has minecraftArguments. The later classpath copy only places legacyfix.jar on -cp; it does not invoke the JAR's Premain-Class, so those legacy versions launch without any LegacyFix patches.

Useful? React with 👍 / 👎.

@@ -1,4 +1,4 @@
<ResourceDictionary
<ResourceDictionary

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the extra BOM from en-US.xaml

The file now starts with two UTF-8 BOMs (EF BB BF EF BB BF), so XML readers treat the second marker as content before the root element. When the English ResourceDictionary is parsed or LocalizationTest.LoadKeyList calls XDocument.Load, the file is not well-formed and English localization loading fails before any keys can be read.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 932c3c0c70

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ModBase.Log("[Launch] LegacyFix 已被禁用");
return false;
}
var needs = mc.releaseTime < new DateTime(2013, 6, 25);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate LegacyFix on known old versions

For custom/unknown instances that omit releaseTime, McInstance sets releaseTime to 1970-01-01 (McInstance.cs lines 162-163), so this date-only check now returns true even though the version was not identified as <=1.5.x. That makes PCL copy/inject LegacyFix for arbitrary modern/custom JSONs, and in the new-JVM-args path adds a -javaagent, which can break launch or alter the classpath unexpectedly; keep the existing known-date/Drop guard before treating the instance as legacy.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8d41d3a07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ModBase.Log("[Launch] LegacyFix 已被禁用");
return false;
}
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate LegacyFix to legacy releases

Even for known 1.6+ or current releases, this helper falls through to return true, and both callers then extract/inject legacyfix.jar (the new JVM path adds it as -javaagent). That makes the LegacyFix agent run for normal modern instances despite the UI text saying it is for 1.5.x and below, which can break launches or alter behavior outside the intended legacy scope; keep the old version/Drop guard before returning true.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 636400f52d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread PCL.Core/App/Config.cs
/// 禁用 LegacyFix
/// </summary>
[ConfigItem<bool>("LaunchAdvanceDisableRW", false, ConfigSource.Local)] public partial bool DisableRw { get; set; }
[ConfigItem<bool>("LaunchAdvanceDisableLF", false, ConfigSource.Local)] public partial bool DisableLF { get; set; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve existing wrapper opt-outs

When upgrading a profile where LaunchAdvanceDisableRW is already true, this renamed ConfigItem reads the new LaunchAdvanceDisableLF key with the default false instead, and the old key is no longer referenced anywhere. That silently re-enables legacy-wrapper injection for users who explicitly disabled it for old-version launches; please migrate or alias the old global/per-instance keys before defaulting the new LegacyFix setting to enabled.

Useful? React with 👍 / 👎.

@zkitefly

Copy link
Copy Markdown
Contributor Author

要写鸣谢吗?

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11ecdf3abf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (McLaunchNeedsLegacyFix(instance))
{
var legacyFixPath = Path.Combine(ModBase.pathPure, "legacyfix.jar");
dataList.Add("-javaagent:\"" + legacyFixPath + "\"");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Route LegacyFix through a recognized launcher

When a legacy instance reaches this new-JVM-args path with Java Wrapper enabled (the block immediately below, on UTF-8 code pages) or with a normal Minecraft main class, the JVM command seen by the bundled LegacyFixAgent is not one of the launchers its required launcher patch accepts (LegacyFixLauncher, Prism/MultiMC, or LaunchWrapper). The agent exits on unknown launchers during premain, so adding it as a bare -javaagent can abort these launches before Minecraft starts; this path needs to invoke/identify LegacyFix’s launcher instead of only attaching the agent.

Useful? React with 👍 / 👎.

@LinQingYuu LinQingYuu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你把 LegacyFix 加到新版本 JVM 参数里了

另外应该在 metadata 附上 Repo 和许可证

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M PR 大小评估:中型 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants