[Enhancement] 原理图管理优化 #6094
Conversation
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
# 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
|
/gemini review |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
💡 Codex Review
HMCL/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java
Lines 253 to 254 in ed68b0d
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".
Resolves #4052 Resolves #4518 Resolves #3957
#3597 应在本 PR 合并后并实现 NBT 修改功能后关闭