Skip to content

fix(launch): fix mc before 13w25a - #3606

Open
fakeboboliu wants to merge 1 commit into
PCL-Community:devfrom
fakeboboliu:dev-2635
Open

fix(launch): fix mc before 13w25a#3606
fakeboboliu wants to merge 1 commit into
PCL-Community:devfrom
fakeboboliu:dev-2635

Conversation

@fakeboboliu

@fakeboboliu fakeboboliu commented Sep 10, 2026

Copy link
Copy Markdown

This PR fixes #2635.

问题

if (!string.IsNullOrEmpty(
(string)ModInstanceList.McMcInstanceSelected.JsonObject["minecraftArguments"])) // 有的实例 JSON 中是空字符串
{
McLaunchLog("获取旧版 Game 参数");
arguments += " " + McLaunchArgumentsGameOld(ModInstanceList.McMcInstanceSelected);
McLaunchLog("旧版 Game 参数获取成功");
}

使用 minecraftArguments 判断进入下面旧版参数生成逻辑,符合原 issue 中的 13w18a 元数据 特征。

private static string McLaunchArgumentsGameOld(McInstance version)
{
var dataList = new List<string>();
// 本地化 Minecraft 启动信息
var basicString = version.JsonObject["minecraftArguments"].ToString();
if (!basicString.Contains("--height"))
basicString += " --height ${resolution_height} --width ${resolution_width}";
dataList.Add(basicString);

此处总是会添加宽高启动参数。
分析 13w18a 入口可以注意到,其并不支持宽高参数,且在指定相关参数时报错。

分析前一个正式版(1.5.2)注意到,其不支持宽高参数,但在指定无关参数时不会报错。
后一个正式版(1.6)支持宽高参数,第一个支持宽高参数的测试版是 13w25a(2013-06-17)。

影响范围

初步检查,应当是 13w16a-13w25a(不含)。

Sourcery 摘要

错误修复:

  • 启动 13w25a 之前发布的 Minecraft 版本时,防止添加不受支持的窗口大小参数。
Original summary in English

Sourcery 总结

错误修复:

  • 启动 13w25a 之前发布的 Minecraft 版本时,防止添加不受支持的窗口大小参数。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Prevent unsupported window-size arguments from being added when launching Minecraft versions released before 13w25a.

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

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
审查者指南(小型 PR 中折叠显示)

审查者指南

旧版 Minecraft 参数构建器现在使用发布日期,以避免向 13w25a 之前的版本添加分辨率参数,同时保留现有的重复参数处理逻辑。

旧版 Minecraft 分辨率参数处理流程图

flowchart TD
    A["Build legacy Minecraft arguments"] --> B{"minecraftArguments contains --height?"}
    B -->|Yes| C["Keep existing arguments"]
    B -->|No| D{"releaseTime >= 2013-06-17?"}
    D -->|Yes| E["Append height and width parameters"]
    D -->|No| F["Keep existing arguments"]
    C --> G["Add arguments to dataList"]
    E --> G
    F --> G
Loading

文件级变更

变更 详细信息 文件
将自动注入分辨率参数的范围限制为支持宽度和高度参数的 Minecraft 版本。
  • 保留现有的检查逻辑,以避免重复添加 --height 参数。
  • 仅当 releaseTime >= 2013-06-17 时追加 ${resolution_height}${resolution_width},该日期对应快照 13w25a。
  • 对于 13w25a 之前的版本,不注入分辨率参数,以避免启动失败。
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs

针对相关 Issue 的评估

Issue 目标 是否已解决 说明
#2635 修复 13w18a 无法启动的问题,使启动参数兼容该版本的 Minecraft。

可能相关的 Issue

  • 无法启动13w18a #2635:PR 针对 13w18a 及 13w16a 至 13w25a 版本移除不兼容的宽高启动参数,直接解决该启动问题。

提示与命令

与 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 (collapsed on small PRs)

Reviewer's Guide

The legacy Minecraft argument builder now uses the release date to avoid adding resolution parameters to versions before 13w25a, while preserving existing duplicate-argument handling.

Flow diagram for legacy Minecraft resolution argument handling

flowchart TD
    A["Build legacy Minecraft arguments"] --> B{"minecraftArguments contains --height?"}
    B -->|Yes| C["Keep existing arguments"]
    B -->|No| D{"releaseTime >= 2013-06-17?"}
    D -->|Yes| E["Append height and width parameters"]
    D -->|No| F["Keep existing arguments"]
    C --> G["Add arguments to dataList"]
    E --> G
    F --> G
Loading

File-Level Changes

Change Details Files
Restrict automatic resolution argument injection to Minecraft versions that support width and height parameters.
  • Retain the existing check that avoids duplicate --height arguments.
  • Gate appending ${resolution_height} and ${resolution_width} on releaseTime >= 2013-06-17, corresponding to snapshot 13w25a.
  • Leave pre-13w25a versions without injected resolution arguments to prevent launch failures.
Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#2635 修复 13w18a 无法启动的问题,使启动参数兼容该版本的 Minecraft。

Possibly linked issues

  • 无法启动13w18a #2635: PR 针对13w18a及13w16a至13w25a版本移除不兼容的宽高启动参数,直接解决该启动问题。

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T08:16:25.861637Z d5e048b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

嘿——我已经审阅了你的更改,看起来很棒!


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享它们 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@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: d5e048b2c7

ℹ️ 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 Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs
@MoYuan-CN
MoYuan-CN requested a review from a team September 10, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

无法启动13w18a

1 participant