Skip to content

fix(instance-saves-datapack): 修复数据包下载路径错误#3348

Open
LuLu-ling wants to merge 2 commits into
devfrom
fix/datapack-download-path
Open

fix(instance-saves-datapack): 修复数据包下载路径错误#3348
LuLu-ling wants to merge 2 commits into
devfrom
fix/datapack-download-path

Conversation

@LuLu-ling

@LuLu-ling LuLu-ling commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

Bug Fixes:

  • 更正数据包下载的缓存文件夹路径,使其指向当前实例存档的 datapacks 目录。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Correct the datapack download cached folder path to point to the current instance save’s datapacks directory.

@LuLu-ling LuLu-ling requested a review from a team July 5, 2026 06:52
@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: XS PR 大小评估:微型 labels Jul 5, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

此 PR 修复了数据包下载管理的行为,确保下载组件在导航到数据包下载页面之前,会使用当前世界存档的 datapacks 文件夹作为其缓存目标。

数据包下载管理点击处理的时序图

sequenceDiagram
    actor User
    participant PageInstanceSavesDatapack
    participant PageDownloadCompDetail
    participant frmMain
    participant PageComp

    User->>PageInstanceSavesDatapack: BtnManageDownload_Click
    PageInstanceSavesDatapack->>PageDownloadCompDetail: cachedFolder[DataPack] = Path.Combine(currentSave, "datapacks")
    PageInstanceSavesDatapack->>frmMain: PageChange(Download, DownloadDataPack)
    PageInstanceSavesDatapack->>PageComp: targetVersion = McInstance
Loading

File-Level Changes

Change Details Files
在打开数据包下载管理页面时,确保数据包下载被缓存到当前存档的 datapacks 子文件夹中。
  • 在导航之前,将 DataPack 组件类型的 cachedFolder 条目设置为当前选定存档路径下的 datapacks 子目录。
  • 使用 PageInstanceSavesLeft.currentSave 与 "datapacks" 组合来计算数据包下载的正确目标文件夹。
  • 保持现有到 DownloadDataPack 页面和版本过滤行为不变。
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs

Tips and commands

与 Sourcery 交互

  • 触发新的代码审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 通过回复某条审查评论,让 Sourcery 从该评论创建一个 issue。你也可以回复审查评论 @sourcery-ai issue 来从评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写上 @sourcery-ai,即可随时生成标题。也可以在拉取请求中评论 @sourcery-ai title 以在任何时候(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写上 @sourcery-ai summary,即可在你需要的位置随时生成 PR 摘要。也可以在拉取请求中评论 @sourcery-ai summary 来在任何时候(重新)生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可在任何时候(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,以解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 关闭所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,以关闭所有现有的 Sourcery 审查。特别适用于你想从一个全新的审查开始——别忘了再评论 @sourcery-ai review 来触发新的审查!

自定义你的体验

访问你的 控制面板 来:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 修改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR fixes the datapack download management behavior by ensuring the download component uses the current world save’s datapacks folder as its cache target before navigating to the datapack download page.

Sequence diagram for datapack download management click handling

sequenceDiagram
    actor User
    participant PageInstanceSavesDatapack
    participant PageDownloadCompDetail
    participant frmMain
    participant PageComp

    User->>PageInstanceSavesDatapack: BtnManageDownload_Click
    PageInstanceSavesDatapack->>PageDownloadCompDetail: cachedFolder[DataPack] = Path.Combine(currentSave, "datapacks")
    PageInstanceSavesDatapack->>frmMain: PageChange(Download, DownloadDataPack)
    PageInstanceSavesDatapack->>PageComp: targetVersion = McInstance
Loading

File-Level Changes

Change Details Files
Ensure datapack downloads are cached to the current save’s datapacks subfolder when opening the datapack download management page.
  • Set the cachedFolder entry for the DataPack component type to the datapacks subdirectory under the currently selected save path before navigation.
  • Use PageInstanceSavesLeft.currentSave combined with "datapacks" to compute the correct target folder for datapack downloads.
  • Keep existing navigation to the DownloadDataPack page and version filter behavior unchanged.
Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.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 - 我在这里留下了一些整体反馈:

  • 建议将“datapacks”子文件夹名称提取到一个共享常量或辅助函数中,以避免使用硬编码字符串,并在整个代码库中保持 datapack 路径逻辑的一致性。
面向 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Consider extracting the "datapacks" subfolder name into a shared constant or helper to avoid hardcoded strings and keep the datapack path logic consistent across the codebase.

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

Hey - I've left some high level feedback:

  • Consider extracting the "datapacks" subfolder name into a shared constant or helper to avoid hardcoded strings and keep the datapack path logic consistent across the codebase.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider extracting the "datapacks" subfolder name into a shared constant or helper to avoid hardcoded strings and keep the datapack path logic consistent across the codebase.

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.

@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: 01202cbb1d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

1 participant