Skip to content

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

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

[Enhancement] 原理图管理优化 #6094
ToobLac wants to merge 82 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 修改功能后关闭

Calboot and others added 25 commits February 24, 2026 11:23
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java
# Conflicts:
#	HMCL/src/main/resources/assets/lang/I18N_ar.properties
# Conflicts:
#	HMCL/src/main/resources/assets/css/root.css
# Conflicts:
#	HMCL/src/main/resources/assets/css/root.css
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java
# Conflicts:
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java
@Minecraft269

Copy link
Copy Markdown

/gemini review

@Wulian233

Copy link
Copy Markdown
Contributor

@codex

@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 schematic management system, introducing a unified Schematic base class and supporting Litematic, Schem, and NBT Structure formats. It also updates the UI to support directory navigation, mod installation, and custom schematic directories. The code review identified several critical issues, most notably a deadlock risk in ModManager where lock.lock() is incorrectly called in a finally block instead of lock.unlock(). Additionally, feedback highlights potential race conditions in SchematicsPage during asynchronous operations and version switching, risks of duplicate elements upon retry of failed directory loads, missing dimension validation in SchemFile, and a potential integer overflow when calculating total volume in Schematic.

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/mod/ModManager.java Outdated
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java Outdated
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java Outdated
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/SchemFile.java Outdated
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/Schematic.java Outdated

@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

fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(
i18n("extension.schematic"), "*.litematic"));

P2 Badge Include all supported schematic extensions

The page now loads and accepts drag-and-drop for .schem, .schematic, and .nbt via Schematic.isFileSchematic, but the Add dialog still filters only *.litematic. Users trying to import the newly supported formats through the toolbar will not be able to select those files, leaving the new support inaccessible from the primary add flow.

ℹ️ 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/ModManager.java Outdated
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java
Comment thread HMCLCore/src/main/java/org/jackhuang/hmcl/schematic/Schematic.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants