-
Notifications
You must be signed in to change notification settings - Fork 733
添加 Modrinth 整合包导出 #3716
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?
添加 Modrinth 整合包导出 #3716
Conversation
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.
文案建议(English)
其他语言稍后
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.
文案建议(繁體中文)
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.
文案建议(Español)
俄语和日语似乎少了 |
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
a4d0569 更新了 |
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
Co-authored-by: 3gf8jv4dv <[email protected]>
@Glavo cc? |
@Glavo 有计划在稳定版前合并吗( |
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 adds support for exporting modpacks in the Modrinth format. It introduces a new export task, updates modpack export configuration to include flags for remote resource matching, adjusts the modpack blacklist accordingly, and modifies UI pages and language files for consistent Modrinth integration.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthModpackExportTask.java | New export task for creating Modrinth modpacks and handling remote file matching. |
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModpackExportInfo.java | Added new boolean flags and options to control remote file matching behavior. |
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModAdviser.java | Updated modpack blacklist with additional rules including entries for Modrinth exports. |
HMCL/src/main/resources/assets/lang/*.properties | Added new translation keys and updated strings for Modrinth-related export parameters. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/export/*.java | Modified modpack selection and export info pages to include Modrinth as an export option with corresponding file extension and toggle controls. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/export/ExportWizardProvider.java | Integrated the new Modrinth export task into the export wizard flow. |
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthModpackExportTask.java
Show resolved
Hide resolved
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthModpackExportTask.java
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
|
||
ModrinthManifest.File fileEntry = tryGetRemoteFile(file, relativePath); |
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.
请避免同步网络请求,应将请求下载源数据的代码分离至独立的 Task,并使用 getDependencies / getDependents 来链接到 ModrinthModpackExportTask。
try { | ||
modrinthVersion = ModrinthRemoteModRepository.MODS.getRemoteVersionByLocalFile(localModFile, file); | ||
} catch (IOException e) { | ||
LOG.warning("Failed to get remote file from Modrinth for: " + file, e); |
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.
也就是说请求失败就直接终止导出?
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthModpackExportTask.java
Outdated
Show resolved
Hide resolved
blackList.add(version + ".jar"); | ||
blackList.add(version + ".json"); | ||
LOG.info("Compressing game files without some files in blacklist, including files or directories: usernamecache.json, asm, logs, backups, versions, assets, usercache.json, libraries, crash-reports, launcher_profiles.json, NVIDIA, TCNodeTracker"); | ||
try (Zipper zip = new Zipper(modpackFile.toPath())) { |
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.
新代码应避免使用 Zipper。请转向 CompressingUtils 中构造的 FileSystem
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.
新代码应避免使用 Zipper。请转向 CompressingUtils 中构造的 FileSystem
新代码请不要使用 FileSystem,尤其是不应该使用 FileSystem 写入 ZIP 文件,这存在相当多问题。
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.
新代码应避免使用 Zipper。请转向 CompressingUtils 中构造的 FileSystem
新代码请不要使用 FileSystem,尤其是不应该使用 FileSystem 写入 ZIP 文件,这存在相当多问题。
请求在另一个 Issue 中列出目前 jrt FileSystem 存在的问题。FileSystem 相较于 Zipper / Unzipper / ZipArchiveReader 有较高自由度。
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.
那就先保持这样?因为 MMC 和 MCBBS 整合包都是使用 Zipper
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthModpackExportTask.java
Outdated
Show resolved
Hide resolved
…hModpackExportTask.java Co-authored-by: Copilot <[email protected]>
…/HMCL into modrinth-modpack-output
感觉没啥用啊( 我也不敢直接抛错误啊,文档说这个值只是帮助启动器显示进度条的。(详细请查看 https://support.modrinth.com/en/articles/8802351 对 fileSize 的介绍)
HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthModpackExportTask.java
Outdated
Show resolved
Hide resolved
@@ -747,7 +748,10 @@ modpack.wizard.step.3.title=选择整合包导出类型 | |||
modpack.wizard.step.initialization.exported_version=要导出的游戏版本 | |||
modpack.wizard.step.initialization.force_update=强制升级整合包至最新版本 (需要自建服务器) | |||
modpack.wizard.step.initialization.include_launcher=包含启动器 | |||
modpack.wizard.step.initialization.modrinth.info=在整合包创建过程中,启动器将匹配 CurseForge/Modrinth 远程资源替代本地文件(包括模组、资源包和光影包)以缩减整合包体积,并将扩展名为“.disabled”的文件标注为“安装时可选项”。 | |||
modpack.wizard.step.initialization.no_create_remote_files=不匹配远程文件 |
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.
如果这两个选项不是必要的话,那建议先不引入,后续再讨论是否要引入,该起什么名字。
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.
更名为“打包资源文件”如何?
_dde-file-manager_20250308020906.mp4
Fabulously Optimized.mrpack.zip
可能需要改进翻译
HMCL-3.6.SNAPSHOT.zip 测试版本