-
Notifications
You must be signed in to change notification settings - Fork 804
[Enhancement] [Bugfix] [Feature] 资源包有关优化与修复 #4980
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?
Conversation
|
需要懂其他语言的人完善 i18n |
在BMC4中测试时发现BMC4会判定所有资源包兼容,与原版表现不符,会导致启用/禁用功能失效,故添加警告
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.
我在 CF 和 MR 分别下载了好几个资源包,结果都显示「游戏版本元数据缺失」。如果真的要为这个显示警告的话,可能很多人都会迷惑。
可能是我搞错了,我还在弄清楚这一块。
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcepackFile.java
Outdated
Show resolved
Hide resolved
|
我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。 |
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
确实是,我在修 |
…esourcepack-enhancement
Solved |
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 enhances resource pack management with a comprehensive refactoring that introduces enable/disable functionality, detailed information dialogs, and fixes several bugs including the shader pack download dialog title issue (#4680). The changes align the resource pack interface with the existing mod management system.
- Refactored resource pack classes into a sealed hierarchy with ResourcePackFile as base class
- Added ResourcePackManager for centralized resource pack operations including enable/disable state management
- Implemented resource pack compatibility checking based on Minecraft version and pack format
- Added search functionality and detail dialogs with remote repository integration
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| VersionRange.java | Added only() factory method for single-version ranges |
| FileUtils.java | Fixed getNameWithoutExtension() to handle directories correctly |
| StringUtils.java | Added serialization/deserialization utilities for string lists in options files |
| PackMcMeta.java | Extended with SupportedFormats record and updated PackVersion validation logic |
| ResourcePackFile.java | New sealed abstract base class with enable/disable and compatibility support |
| ResourcePackFolder.java | Renamed and refactored folder-based resource pack implementation |
| ResourcePackZipFile.java | Renamed and refactored ZIP-based resource pack implementation |
| ResourcePackManager.java | New manager class handling resource pack operations, compatibility checking, and options file I/O |
| RemoteModRepository.java | Updated API to remove LocalModFile parameter and add SHADER type |
| RemoteMod.java | Added repository type field to support different content types |
| CurseAddon.java, ModrinthRemoteModRepository.java | Updated to pass repository type when creating RemoteMod instances |
| GameRepository.java | Added getResourcePackDirectory() method to interface |
| DefaultGameRepository.java | Implemented resource pack directory method, removed old getResourcepacksDirectory() |
| ResourcePackListPage.java | Complete rewrite with search, multi-select, enable/disable, and detail dialog features |
| VersionPage.java | Updated class name reference from ResourcepackListPage to ResourcePackListPage |
| DownloadPage.java | Refactored download callbacks into constants and added shader pack title support |
| ModListPageSkin.java | Updated to use new remote version API signature |
| I18N*.properties | Added translations for enable/disable buttons and resource pack warnings |
| root.css | Added warning pseudo-class styling for resource pack list cells |
Comments suppressed due to low confidence (1)
HMCLCore/src/main/java/org/jackhuang/hmcl/resourcepack/ResourcePackZipFile.java:16
- The class name has changed from ResourcepackZipFile (with lowercase 'p') in line 16 to ResourcePackZipFile (with capital 'P'). However, the file name in the diff header shows it as "ResourcePackZipFile.java" while the old content shows "ResourcepackZipFile" (lowercase 'p' in "pack"). This naming inconsistency should be resolved - either the old file should be renamed or this is a case-sensitivity issue that might cause problems on case-insensitive filesystems.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcePackListPage.java
Show resolved
Hide resolved
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcePackListPage.java
Outdated
Show resolved
Hide resolved
|
如果能显示已启用资源包的顺序,就更好了。目前在启动器内勾选多个资源包时,先勾选的在游戏中排下面,最后勾选的在游戏内排上面。不熟悉的用户可能会感到迷惑。 |
资源包是否被被启用的判定很大程度上会受到模组影响,本来就是仅供参考的。我不太希望对游戏的资源包列表有太多更改,更改越多bug就可能越多 比如说,如果一个不兼容的资源包在已加载资源包的列表里且不在不兼容列表里,那我们如何显示它的位置? 以及这样会导致列表很混乱 而且本来就是后启用的在上面吧( |
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
| mods.channel.beta=Beta | ||
| mods.channel.release=Release | ||
| mods.check_updates=Mod update process | ||
| mods.check_updates=File update process |
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.
感觉不是太好吧……我更建议使用各自的文本,例如「资源包更新检查」。
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.
其实你用的时候是感觉不出来的
具体改动
ILocalFile和LocalFileManager<T extends ILocalFile>,使更新对于模组以外的东西(如资源包和光影包)也能适用,从而实现了资源包更新(不保留旧版本)