Skip to content

[Enhancement] 原理图管理优化 #6094

Open
ToobLac wants to merge 106 commits into
HMCL-dev:mainfrom
ToobLac:litematica
Open

[Enhancement] 原理图管理优化 #6094
ToobLac wants to merge 106 commits into
HMCL-dev:mainfrom
ToobLac:litematica

Conversation

@ToobLac

@ToobLac ToobLac commented May 16, 2026

Copy link
Copy Markdown
Contributor

Resolves #4052 Resolves #4518 Resolves #3957

#3597 应在本 PR 合并后并实现 NBT 修改功能后关闭

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors and extends the launcher's schematics management by introducing a unified Schematic base class and adding support for new formats, including legacy/Sponge .schematic/.schem files and vanilla .nbt structure files. It also updates the UI to support directory navigation, asynchronous loading, and direct Litematica mod installation. The review feedback identifies several critical issues, including unsafe background thread access to JavaFX properties, potential UI thread blocking from synchronous disk deletion and lock contention, a double-checked locking concurrency bug due to non-volatile fields, and potential parsing failures for large schematics when using tryGetShort instead of tryGetInt.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java Outdated
ToobLac added 3 commits June 19, 2026 18:56
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/game/DefaultGameRepository.java
@Minecraft269

Copy link
Copy Markdown

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors and extends schematic file support in HMCL, introducing a unified Schematic base class with concrete implementations for Litematic, Schem, and NBT Structure formats. It also updates the UI to support these formats, adds custom schematic directory resolution from Litematica's configuration, and refactors mod loader analysis in ModManager. The review feedback highlights a potential NullPointerException in ModManager when analyzer is null, potential overflow issues when parsing large schematic dimensions in SchemFile, and a minor optimization opportunity to avoid a redundant call in SchematicsPage.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/addon/mod/ModManager.java
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java Outdated
ToobLac added 5 commits June 30, 2026 20:46
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java

@Glavo Glavo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

本审查建议由 GPT-5.6 Sol 生成


已将具体审查建议标注在对应代码行。

Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java
@github-actions github-actions Bot added the 1000+ label Jul 17, 2026
@Minecraft269

Copy link
Copy Markdown

试了一下 发现有关 #4518 的问题: 为什么不在没安装 投影 模组时直接隐藏 原理图管理 的入口? 因为测试了一下 发现哪怕是安装了投影 以及环境不支持的情况下 (神tm1.0的MC都提示要安装) 这个 安装投影 的按钮都会亮起

ToobLac added 7 commits July 25, 2026 19:59
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/nbt/NBTFileType.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java
@ToobLac ToobLac mentioned this pull request Jul 27, 2026
5 tasks
ToobLac added 5 commits July 27, 2026 17:54
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

5 participants