Skip to content

fix(modpack): 安装 MCBBS 整合包时 JVM 参数处理有误 - #3499

Open
Pigeon0v0 wants to merge 2 commits into
devfrom
fix/mcbbs-jvm
Open

fix(modpack): 安装 MCBBS 整合包时 JVM 参数处理有误#3499
Pigeon0v0 wants to merge 2 commits into
devfrom
fix/mcbbs-jvm

Conversation

@Pigeon0v0

@Pigeon0v0 Pigeon0v0 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Generated by GPT-5.6 Terra xHigh

Summary by Sourcery

错误修复:

  • 修复在安装 MCBBS 整合包时对 JVM 和游戏参数解析不正确的问题,方式是支持非数组类型的 launchInfo 值。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix incorrect JVM and game argument parsing when installing MCBBS modpacks by supporting non-array launchInfo values.

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

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
审阅者指南(在小型 PR 上折叠)

审阅者指南

此 PR 通过正确支持配置字段的数组和标量两种形式,修复了在安装 MCBBS 整合包时对 JVM 和游戏参数的处理。

文件级变更

变更 详情 文件
正确处理 MCBBS 的 launchInfo 中的 javaArgument 和 launchArgument 字段,在存储 JVM 和游戏参数时同时支持 JsonArray 和标量值。
  • 更新 JvmArgs 的赋值逻辑:当 javaArgument 为 JsonArray 时,将其元素以空格分隔拼接成字符串。
  • 当 javaArgument 不是数组或为 null 时,回退为使用 javaArgument.ToString() 或空字符串。
  • 更新 GameArgs 的赋值逻辑:当 launchArgument 为 JsonArray 时,将其元素以空格分隔拼接成字符串。
  • 当 launchArgument 不是数组或为 null 时,回退为使用 launchArgument.ToString() 或空字符串。
Plain Craft Launcher 2/Modules/Minecraft/ModModpack.cs

提示与命令

与 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

This PR fixes JVM and game argument handling when installing MCBBS modpacks by correctly supporting both array and scalar forms of the configuration fields.

File-Level Changes

Change Details Files
Correct handling of MCBBS launchInfo javaArgument and launchArgument fields, supporting both JsonArray and scalar values when storing JVM and game arguments.
  • Update JvmArgs assignment to detect when javaArgument is a JsonArray and join its elements as a space-separated string.
  • Fallback to using javaArgument.ToString() or an empty string when javaArgument is not an array or is null.
  • Update GameArgs assignment to detect when launchArgument is a JsonArray and join its elements as a space-separated string.
  • Fallback to using launchArgument.ToString() or an empty string when launchArgument is not an array or is null.
Plain Craft Launcher 2/Modules/Minecraft/ModModpack.cs

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
Contributor

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些高层次的反馈:

  • 在拼接 JsonArray 的值时,考虑使用带空值检查的 GetValue<string>(),而不是 argument?.ToString(),以避免 JSON 编码后的输出(例如带引号的字符串)出现在 JVM/游戏参数中。
  • 在调用 string.Join 之前,你可能需要在 JsonArray 中跳过空或为空字符串的条目,否则生成的参数列表中可能会出现多余的空格,或者字面量字符串 "null"
供 AI 代理使用的提示
Please address the comments from this code review:

## Overall Comments
- When joining `JsonArray` values, consider using `GetValue<string>()` (with null checks) instead of `argument?.ToString()` to avoid JSON-encoded output (e.g., quoted strings) ending up in the JVM/game arguments.
- You might want to skip null or empty entries in the `JsonArray` before `string.Join`, otherwise you can end up with extra spaces or the literal string `"null"` in the resulting argument lists.

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

Hey - I've left some high level feedback:

  • When joining JsonArray values, consider using GetValue<string>() (with null checks) instead of argument?.ToString() to avoid JSON-encoded output (e.g., quoted strings) ending up in the JVM/game arguments.
  • You might want to skip null or empty entries in the JsonArray before string.Join, otherwise you can end up with extra spaces or the literal string "null" in the resulting argument lists.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- When joining `JsonArray` values, consider using `GetValue<string>()` (with null checks) instead of `argument?.ToString()` to avoid JSON-encoded output (e.g., quoted strings) ending up in the JVM/game arguments.
- You might want to skip null or empty entries in the `JsonArray` before `string.Join`, otherwise you can end up with extra spaces or the literal string `"null"` in the resulting argument lists.

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.

@pcl-ce-automation pcl-ce-automation Bot added size: S PR 大小评估:小型 and removed size: XS PR 大小评估:微型 labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant