Skip to content

Conversation

@Calboot
Copy link
Contributor

@Calboot Calboot commented Dec 14, 2025

具体改动

  • 修复了资源包管理界面元素边框过粗的问题
  • 修复资源包依赖模组下载错误的问题
  • 添加启用/禁用资源包功能(实验性,有警告)
  • 添加资源包详细信息界面
  • 移除资源包删除按钮,改为与模组界面一致的删除逻辑
  • Fixes [Bug] 实例管理-资源包管理 页面有概率无法用esc退回到主界面 #5037
  • 从一些类里抽象出ILocalFileLocalFileManager<T extends ILocalFile>,使更新对于模组以外的东西(如资源包和光影包)也能适用,从而实现了资源包更新(不保留旧版本)

@Calboot
Copy link
Contributor Author

Calboot commented Dec 14, 2025

需要懂其他语言的人完善 i18n

@Calboot Calboot changed the title [Enhancement] 资源包有关优化与修复 [Enhancement] [Bugfix] 资源包有关优化与修复 Dec 14, 2025
Copy link
Contributor

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

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

我在 CF 和 MR 分别下载了好几个资源包,结果都显示「游戏版本元数据缺失」。如果真的要为这个显示警告的话,可能很多人都会迷惑。

可能是我搞错了,我还在弄清楚这一块。

@3gf8jv4dv
Copy link
Contributor

我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。

Calboot and others added 2 commits December 17, 2025 21:28
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
@Calboot
Copy link
Contributor Author

Calboot commented Dec 17, 2025

我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。

确实是,我在修

@Calboot
Copy link
Contributor Author

Calboot commented Dec 18, 2025

我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。

Solved

@Calboot Calboot marked this pull request as ready for review December 18, 2025 14:53
Copy link
Contributor

Copilot AI left a 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.

@3gf8jv4dv
Copy link
Contributor

如果能显示已启用资源包的顺序,就更好了。目前在启动器内勾选多个资源包时,先勾选的在游戏中排下面,最后勾选的在游戏内排上面。不熟悉的用户可能会感到迷惑。

@Calboot
Copy link
Contributor Author

Calboot commented Dec 21, 2025

如果能显示已启用资源包的顺序,就更好了。目前在启动器内勾选多个资源包时,先勾选的在游戏中排下面,最后勾选的在游戏内排上面。不熟悉的用户可能会感到迷惑。

资源包是否被被启用的判定很大程度上会受到模组影响,本来就是仅供参考的。我不太希望对游戏的资源包列表有太多更改,更改越多bug就可能越多

比如说,如果一个不兼容的资源包在已加载资源包的列表里且不在不兼容列表里,那我们如何显示它的位置?

以及这样会导致列表很混乱

而且本来就是后启用的在上面吧(

Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
@Calboot Calboot marked this pull request as draft December 21, 2025 05:18
@Calboot Calboot marked this pull request as ready for review December 21, 2025 09:46
@Calboot Calboot changed the title [Enhancement] [Bugfix] 资源包有关优化与修复 [Enhancement] [Bugfix] [Feature] 资源包有关优化与修复 Dec 21, 2025
mods.channel.beta=Beta
mods.channel.release=Release
mods.check_updates=Mod update process
mods.check_updates=File update process
Copy link
Contributor

Choose a reason for hiding this comment

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

感觉不是太好吧……我更建议使用各自的文本,例如「资源包更新检查」。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其实你用的时候是感觉不出来的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants