-
Notifications
You must be signed in to change notification settings - Fork 814
feat: 优化世界管理与世界信息页面 #5215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: 优化世界管理与世界信息页面 #5215
Conversation
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListItem.java # HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListItemSkin.java
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldManagePage.java
There was a problem hiding this 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 optimizes world management and world information pages, refactoring code structure, fixing bugs, and adding new features to improve maintainability and user experience.
Changes:
- Refactored WorldManagePage to use the Skin pattern, moving UI construction from the page class to a separate Skin class
- Fixed critical bug in dimension ID mapping (Nether and End dimension IDs were incorrect)
- Added new information fields (world spawn point, saturation level) and improved time display format
- Introduced WorldRefreshable interface and updated refresh mechanism for sub-pages
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| HMCLCore/src/main/java/org/jackhuang/hmcl/util/Lang.java | Added toFloatOrNull utility method |
| HMCLCore/src/main/java/org/jackhuang/hmcl/game/World.java | Added version support methods (supportDatapacks, supportQuickPlay), changed getWorlds return type from Stream to List, made isLocked() compute on each call |
| HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java | Refactored hardcoded version checks to use World.supportQuickPlay() |
| HMCL/src/main/java/org/jackhuang/hmcl/util/ChunkBaseApp.java | Added supportEndCity() method to centralize version checking |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldManagePage.java | Major refactoring: extracted UI construction to Skin class, added refresh mechanism, renamed id to versionId, introduced WorldRefreshable interface |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java | Added launch button to world list items, simplified code, improved formatting |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldInfoPage.java | Fixed dimension ID mapping bug, added world spawn and saturation fields, improved time format, simplified field binding code |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldBackupsPage.java | Changed from using boolean isReadOnly to BooleanProperty for reactive UI updates |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPage.java | Added toast notification for datapack reload, disabled buttons when world is running |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPageSkin.java | Bound button disable states to isReadOnlyProperty |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldManageUIUtils.java | Updated exception handling to catch WorldLockedException instead of IOException |
| I18N*.properties files | Updated translations for new features (world spawn point, saturation, improved time format) |
Comments suppressed due to low confidence (2)
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPage.java:80
- This method overrides WorldRefreshable.refresh; it is advisable to add an Override annotation.
public void refresh() {
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldBackupsPage.java:82
- This method overrides WorldRefreshable.refresh; it is advisable to add an Override annotation.
public void refresh() {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


继续 #4823 对世界信息界面进行的优化
世界管理:
版本特性解析:
世界信息页面:
bug 修复:
修改:
%d 天 %d 小时 %d 分钟而不是%s 天优化:
世界列表页面:
数据包页面
World类: