From c45118ae8db059e56f95b8e7ac45e7e679a18803 Mon Sep 17 00:00:00 2001 From: xirren Date: Sun, 6 Sep 2026 13:58:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=AF=BC=E5=87=BA=20Modrinth=20?= =?UTF-8?q?=E6=95=B4=E5=90=88=E5=8C=85=E6=97=B6=E7=A6=81=E7=94=A8=E6=A8=A1?= =?UTF-8?q?=E7=BB=84=E8=B7=AF=E5=BE=84=E4=BD=BF=E7=94=A8=E6=AD=A3=E6=96=9C?= =?UTF-8?q?=E6=9D=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enableMod 返回的 Path 在 Windows 上使用反斜杠分隔符, 导致 manifest 中禁用模组的 path 与其他文件不一致。 --- .../hmcl/modpack/modrinth/ModrinthModpackExportTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java index eb3a0997c8..9335318d35 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java @@ -93,7 +93,7 @@ public ModrinthModpackExportTask(DefaultGameInstance instance, ModpackExportInfo boolean isDisabled = modManager.isDisabled(file); if (isDisabled) { - relativePath = modManager.enableMod(Paths.get(relativePath)).toString(); + relativePath = modManager.enableMod(Paths.get(relativePath)).toString().replace(File.separatorChar, '/'); } Optional modrinthVersion = Optional.empty(); From df2c02f6eb933ad50586af8c49d72f0d8922f63c Mon Sep 17 00:00:00 2001 From: xirren Date: Sun, 6 Sep 2026 14:05:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=AF=BC=E5=87=BA=20Modrinth=20?= =?UTF-8?q?=E6=95=B4=E5=90=88=E5=8C=85=E6=97=B6=E7=94=A8=E6=97=A0=E5=89=AF?= =?UTF-8?q?=E4=BD=9C=E7=94=A8=E7=9A=84=E6=96=B9=E5=BC=8F=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=A8=A1=E7=BB=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不再调用 enableMod 来间接获取去掉 .disabled 后缀的文件名, 避免导出过程中对实例目录外文件的意外重命名。 --- .../hmcl/modpack/modrinth/ModrinthModpackExportTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java index 9335318d35..dcfe0dc5b0 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthModpackExportTask.java @@ -21,9 +21,9 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.*; +import org.jackhuang.hmcl.addon.LocalAddonManager; import org.jackhuang.hmcl.addon.mod.ModManager; import org.jackhuang.hmcl.addon.repository.ModrinthRemoteAddonRepository; import org.jackhuang.hmcl.game.DefaultGameInstance; @@ -34,6 +34,7 @@ import org.jackhuang.hmcl.modpack.ModpackExportInfo; import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.util.DigestUtils; +import org.jackhuang.hmcl.util.StringUtils; import org.jackhuang.hmcl.util.gson.JsonUtils; import org.jackhuang.hmcl.util.io.Zipper; import org.jackhuang.hmcl.util.versioning.GameVersionNumber; @@ -93,7 +94,7 @@ public ModrinthModpackExportTask(DefaultGameInstance instance, ModpackExportInfo boolean isDisabled = modManager.isDisabled(file); if (isDisabled) { - relativePath = modManager.enableMod(Paths.get(relativePath)).toString().replace(File.separatorChar, '/'); + relativePath = StringUtils.removeSuffix(relativePath, LocalAddonManager.DISABLED_EXTENSION); } Optional modrinthVersion = Optional.empty();