Skip to content

feat: Ornithe 自动安装#5875

Open
CiiLu wants to merge 33 commits intoHMCL-dev:mainfrom
CiiLu:ornithe
Open

feat: Ornithe 自动安装#5875
CiiLu wants to merge 33 commits intoHMCL-dev:mainfrom
CiiLu:ornithe

Conversation

@CiiLu
Copy link
Copy Markdown
Contributor

@CiiLu CiiLu commented Mar 29, 2026

image

CiiLu added 23 commits March 29, 2026 09:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Ornithe (and Ornithe OSL) to HMCL’s “Auto Install” pipeline by introducing new download/version-list/install-task implementations, extending modloader detection & UI surfaces, and updating docs/translations to advertise the new capability.

Changes:

  • Add Ornithe/Ornithe OSL version lists and installation tasks in HMCLCore.
  • Extend LibraryAnalyzer / ModLoaderType / launcher env vars and wire Ornithe into installer UI + icons.
  • Update docs and multiple locale strings to include Ornithe in supported modloader lists.

Reviewed changes

Copilot reviewed 44 out of 47 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
docs/README.md Mention Ornithe in supported modloaders list (English).
docs/README_en_Qabs.md Mention Ornithe in upside-down English README.
docs/README_es.md Mention Ornithe in Spanish README.
docs/README_ja.md Mention Ornithe in Japanese README.
docs/README_lzh.md Mention Ornithe in Literary Chinese README.
docs/README_ru.md Mention Ornithe in Russian README.
docs/README_uk.md Mention Ornithe in Ukrainian README.
docs/README_zh.md Mention Ornithe in Simplified Chinese README.
docs/README_zh_Hant.md Mention Ornithe in Traditional Chinese README.
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/mcbbs/McbbsModpackExportTask.java Refactor manifest addon generation to iterate detected libraries.
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModLoaderType.java Add loader IDs and introduce ORNITHE.
HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java Populate INST_* env vars via detected modloaders.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheVersionList.java New Ornithe version list via meta.ornithemc.net.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheRemoteVersion.java New remote version type for Ornithe loader installs.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheOSLVersionList.java New Modrinth-backed version list for Ornithe OSL.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheOSLRemoteVersion.java New remote version type for Ornithe OSL installs.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheOSLInstallTask.java New install task to download OSL jar into mods folder.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheInstallTask.java New install task that builds an Ornithe patch from launcher meta.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/legacyfabric/LegacyFabricInstallTask.java Update to FabricInfo record accessors.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/fabric/FabricInstallTask.java Convert FabricInfo to a record.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/MojangDownloadProvider.java Register ornithe / ornithe-osl version lists.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/LibraryAnalyzer.java Add ORNITHE(+OSL) detection and expose detected libraries/modloaders.
HMCLCore/src/main/java/org/jackhuang/hmcl/download/BMCLAPIDownloadProvider.java Register ornithe / ornithe-osl version lists.
HMCL/src/main/resources/assets/lang/I18N.properties Add installer labels + update tooltips/messages; adjust custom-commands env hint.
HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties Add installer labels + update tooltips/messages; adjust custom-commands env hint.
HMCL/src/main/resources/assets/lang/I18N_zh.properties Add installer labels + update tooltips/messages; adjust custom-commands env hint.
HMCL/src/main/resources/assets/lang/I18N_uk.properties Update tooltips/messages; remove old custom-commands env hint block.
HMCL/src/main/resources/assets/lang/I18N_ru.properties Update tooltips/messages; remove old custom-commands env hint block.
HMCL/src/main/resources/assets/lang/I18N_lzh.properties Remove old custom-commands env hint block.
HMCL/src/main/resources/assets/lang/I18N_ja.properties Remove old custom-commands env hint block.
HMCL/src/main/resources/assets/lang/I18N_es.properties Update tooltips/messages; remove old custom-commands env hint block.
HMCL/src/main/resources/assets/lang/I18N_ar.properties Remove old custom-commands env hint block.
HMCL/src/main/resources/assets/img/ornithe.png Add Ornithe icon (1x).
HMCL/src/main/resources/assets/img/ornithe@2x.png Add Ornithe icon (2x).
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionIconDialog.java Add Ornithe to icon picker list.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java Display Ornithe loader tags/warnings in mod info UI.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java Extend supported loader detection for mods page.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/InstallerListPage.java Skip displaying Ornithe OSL in installed-libraries list.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java Generate custom-commands env hint lines dynamically per modloader.
HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java Map Ornithe remote versions to Ornithe icon type.
HMCL/src/main/java/org/jackhuang/hmcl/ui/download/InstallersPage.java Add Ornithe to display name mapping.
HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AbstractInstallersPage.java Include Ornithe OSL in “API tip” gating logic.
HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java Name Ornithe install tasks and stage labels in task UI.
HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java Add Ornithe (+OSL) installer items and incompatibility rules.
HMCL/src/main/java/org/jackhuang/hmcl/setting/VersionIconType.java Add ORNITHE icon type.
HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameRepository.java Return Ornithe icon for Ornithe instances.
HMCL/image/ornithe.png Add source image asset for Ornithe icon.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public void execute() throws IOException {
OrnitheInfo ornitheInfo = JsonUtils.GSON.fromJson(launchMetaTask.getResult(), OrnitheInfo.class);
if (ornitheInfo == null)
throw new IOException("Fabric metadata is invalid");
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

The error message says "Fabric metadata is invalid" even though this is Ornithe installation metadata. Update the message to reference Ornithe to make troubleshooting clearer.

Suggested change
throw new IOException("Fabric metadata is invalid");
throw new IOException("Ornithe metadata is invalid");

Copilot uses AI. Check for mistakes.
Comment thread docs/README_zh.md Outdated
## 简介

HMCL 是一款开源、跨平台的 Minecraft 启动器,支持模组管理、游戏自定义、游戏自动安装 (Forge、NeoForge、Cleanroom、Fabric、Legacy Fabric、Quilt、LiteLoader 和 OptiFine)、整合包创建、界面自定义等功能。
HMCL 是一款开源、跨平台的 Minecraft 启动器,支持模组管理、游戏自定义、游戏自动安装 (Forge、NeoForge、Cleanroom、Fabric、Legacy Fabric、Ornithe、 Quilt、LiteLoader 和 OptiFine)、整合包创建、界面自定义等功能。
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

There’s an extra space after the Chinese comma in "Ornithe、 Quilt". Remove the stray space to keep punctuation/spacing consistent in the loader list.

Copilot uses AI. Check for mistakes.
Comment thread docs/README_zh_Hant.md Outdated
## 簡介

HMCL 是一款開源、跨平臺的 Minecraft 啟動器,支援模組管理、遊戲客製化、遊戲自動安裝 (Forge、NeoForge、Cleanroom、Fabric、Legacy Fabric、Quilt、LiteLoader 和 OptiFine)、模組包建立、介面客製化等功能。
HMCL 是一款開源、跨平臺的 Minecraft 啟動器,支援模組管理、遊戲客製化、遊戲自動安裝 (Forge、NeoForge、Cleanroom、Fabric、Legacy Fabric、Ornithe、 Quilt、LiteLoader 和 OptiFine)、模組包建立、介面客製化等功能。
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

There’s an extra space after the punctuation in "Ornithe、 Quilt". Remove the stray space to keep the loader list formatting consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +229 to +241
ORNITHE(true, "ornithe", "net\\.fabricmc", "fabric-loader", ModLoaderType.ORNITHE) {
@Override
protected boolean matchLibrary(Library library, List<Library> libraries) {
if (!super.matchLibrary(library, libraries)) {
return false;
}
for (Library l : libraries) {
if ("net.ornithemc".equals(l.getGroupId())) {
return false;
}
}
return true;
}
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

LibraryType.ORNITHE.matchLibrary currently returns false when it detects any net.ornithemc library in the version. If Ornithe installations include net.ornithemc artifacts (which is expected), this prevents ORNITHE from ever being detected and will likely misclassify it as FABRIC. Reverse this logic so the presence of net.ornithemc libs is treated as the Ornithe signal (and/or explicitly exclude Ornithe from FABRIC detection).

Copilot uses AI. Check for mistakes.
Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java Outdated
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 17, 2026

@codex review

Copy link
Copy Markdown

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

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: 821aaa0ca8

ℹ️ 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/mod/mcbbs/McbbsModpackExportTask.java Outdated
@3gf8jv4dv
Copy link
Copy Markdown
Contributor

前段时间简单测试过,问题看起来不少。之后我找时间写个详细的报告。

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 23, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the Ornithe mod loader and Ornithe OSL across the launcher. Changes include new installation tasks, version list providers, UI integration for installer items and icons, and updated I18N strings. The review feedback identifies several critical issues: a logic reversal in the library analyzer that prevents Ornithe detection, incorrect usage of the task dependency system in installation tasks, and a typo in a localized key. Additionally, there is a concern regarding the generation of version lists which could lead to UI performance issues.

Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/download/LibraryAnalyzer.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java Outdated
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 24, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the Ornithe mod loader and Ornithe OSL (Ornithe Standard Library) across the launcher. Key changes include the addition of Ornithe-specific installation tasks, version list providers, and UI integration for version selection and mod management. The PR also refactors several areas to handle mod loaders more dynamically, such as environment variable generation during launch and addon exporting for MCBBS modpacks. Feedback identifies several critical issues: a missing getModLoaders method in LibraryAnalyzer that will cause compilation errors, missing synchronization and list clearing in the new Ornithe version list tasks, and a logic error in the MCBBS export task that results in duplicate entries. Additionally, improvements were suggested for Ornithe version fetching logic to avoid redundant UI entries and for minor localization and error message corrections.

Comment thread HMCL/src/main/resources/assets/lang/I18N.properties Outdated
CiiLu and others added 3 commits April 25, 2026 20:41
…itheInstallTask.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 25, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the Ornithe mod loader and Ornithe OSL, including new installation tasks, version list providers, and UI integration. It refactors mod loader handling to be more dynamic across the launcher, specifically for environment variable generation and modpack export logic. However, several critical issues were identified, including a missing method in LibraryAnalyzer that causes compilation failures, unhandled exceptions in asynchronous tasks, and potential null pointer exceptions in the new installation and networking logic. Additionally, the refactoring of custom command hints led to missing localization keys in multiple language files, which needs to be addressed to prevent UI display issues.

I am having trouble creating individual review comments. Click here to see my feedback.

HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java (681)

critical

analyzer.getModLoaders() 方法在 LibraryAnalyzer 类中似乎并未定义。在 LibraryAnalyzer.java 的补丁中只看到了 getLibraries() 方法。这会导致编译错误。请确保在 LibraryAnalyzer 中实现了该方法,或者检查是否遗漏了相关的代码提交。

HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheVersionList.java (49-50)

critical

getGameVersions 方法声明了抛出 IOException,但在 Task.runAsync 的 lambda 表达式中没有进行异常处理。如果 Task.runAsync 接受的是标准的 Runnable,这将导致编译错误。建议在 lambda 内部捕获并处理异常,或者确保使用的 runAsync 版本支持抛出异常的函数式接口。

HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheInstallTask.java (69)

high

version.resolve(dependencyManager.getGameRepository()) 的返回值可能为 null。如果解析失败,直接调用 .getMainClass() 会触发 NullPointerException。建议先进行非空检查。

HMCL/src/main/resources/assets/lang/I18N_ar.properties (1305-1318)

medium

在此文件(以及其他语言文件如 I18N_es.properties, I18N_ja.properties, I18N_lzh.properties, I18N_ru.properties, I18N_uk.properties)中,settings.advanced.custom_commands.hint 键被完全删除了,且没有添加新的 settings.advanced.custom_commands.env 键。这会导致高级设置页面在这些语言下显示异常(显示原始键名且缺少提示信息)。建议保留 hint 键作为标题,并添加对应的 env 翻译。

HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheInstallTask.java (126-127)

medium

硬编码了 Maven 仓库地址 https://maven.ornithemc.net/releases/。建议将其提取为常量,或者使用 DownloadProvider 提供的机制来处理,以便于后续维护和支持镜像。

HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheVersionList.java (70-71)

medium

如果 NetworkUtils.doGet 返回 null(例如在网络错误时),JsonUtils.GSON.fromJson 也会返回 null,随后调用 .stream() 将导致 NullPointerException。建议在流操作前检查 fromJson 的返回值。

HMCLCore/src/main/java/org/jackhuang/hmcl/download/ornithe/OrnitheOSLVersionList.java (45)

medium

硬编码了 Modrinth 项目 ID EHGtwpJv。建议将其定义为常量以提高代码可读性和可维护性。

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 26, 2026

@codex review

Copy link
Copy Markdown

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

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: 8b904283fd

ℹ️ 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".

analyzer.getVersion(LEGACY_FABRIC).ifPresent(legacyfabricVersion ->
addons.add(new McbbsModpackManifest.Addon(LEGACY_FABRIC.getPatchId(), legacyfabricVersion)));
for (LibraryAnalyzer.LibraryType type : analyzer.getLibraries()) {
if (type == OPTIFINE || type == BOOTSTRAP_LAUNCHER || type == MINECRAFT) continue;
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 OptiFine addon in exported MCBBS manifests

When exporting a modpack that includes OptiFine, this new filter drops it from mcbbs.packmeta even though the installer reconstructs loader state from addons. As a result, re-importing the exported pack no longer reinstalls OptiFine, so the exported modpack is not a faithful reproduction of the source instance.

Useful? React with 👍 / 👎.

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 27, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the Ornithe mod loader and Ornithe OSL. The changes include new installation tasks, version list providers, and extensive UI updates to handle Ornithe-specific icons, incompatibility rules, and environment variables. Additionally, the FabricInfo class was refactored into a record, and the logic for injecting mod loader environment variables during launch was simplified. Feedback focuses on a compilation error caused by unhandled checked exceptions in an asynchronous task, a logic error where server libraries were included instead of client libraries in the installation task, and missing result initialization in the OSL installation task.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants