Skip to content

perf(download): skip re-installing loader if identical version patch … - #6594

Open
fatelove42 wants to merge 1 commit into
HMCL-dev:mainfrom
fatelove42:perf/skip-duplicate-modloader-install
Open

perf(download): skip re-installing loader if identical version patch …#6594
fatelove42 wants to merge 1 commit into
HMCL-dev:mainfrom
fatelove42:perf/skip-duplicate-modloader-install

Conversation

@fatelove42

@fatelove42 fatelove42 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

整合包升级时跳过版本重复的modloader下载安装

@github-actions github-actions Bot added the 1+ label Aug 3, 2026
@Glavo

Glavo commented Aug 4, 2026

Copy link
Copy Markdown
Member

@codex review

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

ℹ️ 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 on lines +164 to +165
if (existingPatch.isPresent() && java.util.Objects.equals(existingPatch.get().version(), libraryVersion.getSelfVersion())) {
return Task.completed(baseVersion);

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 Preserve loader installation for fresh HMCL imports

When importing an HMCL modpack for the first time, HMCLModpackInstallTask.execute starts with the manifest embedded in minecraft/pack.json and deliberately calls this method for every loader because Forge and OptiFine libraries must be obtained through their installers. That embedded manifest already contains the matching patch ID and version, so this return bypasses getInstallTask and all of its download tasks, leaving a fresh imported instance without the required loader libraries. Restrict this shortcut to updates where the loader was already installed in the existing instance rather than treating a patch in the desired manifest as proof of installation.

Useful? React with 👍 / 👎.

Comment on lines +164 to +165
if (existingPatch.isPresent() && java.util.Objects.equals(existingPatch.get().version(), libraryVersion.getSelfVersion())) {
return Task.completed(baseVersion);

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 Rebuild same-version loaders after changing Minecraft

When a user changes the Minecraft version but reselects the same Fabric or Quilt loader version, AdditionalInstallersPage requires that loader to be reinstalled for compatibility. The patch version compared here identifies only the loader version, while the generated patch contains game-specific metadata such as Fabric's intermediary library; therefore this equality succeeds against the old patch even though libraryVersion.getGameVersion() targets a different Minecraft release. The upgrade then retains the old game-specific loader metadata and can produce an unlaunchable instance, so the shortcut must also establish that the loader patch belongs to the same Minecraft version.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added 10+ and removed 1+ labels Aug 4, 2026
@fatelove42

fatelove42 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@Glavo

Glavo commented Aug 4, 2026

Copy link
Copy Markdown
Member

@codex review

@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: 23ee8091d6

ℹ️ 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 HMCLCore/src/main/java/org/jackhuang/hmcl/download/DefaultDependencyManager.java Outdated
@github-actions github-actions Bot added 100+ and removed 10+ labels Aug 4, 2026
@fatelove42
fatelove42 force-pushed the perf/skip-duplicate-modloader-install branch from 61eda27 to 41a17dd Compare August 4, 2026 12:47
@fatelove42
fatelove42 force-pushed the perf/skip-duplicate-modloader-install branch from 41a17dd to 6499b20 Compare August 4, 2026 12:50
@github-actions github-actions Bot added 40+ and removed 100+ labels Aug 4, 2026
@fatelove42

Copy link
Copy Markdown
Contributor Author

哈基米把我总test合到branch了()

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants