From 0fc8222e632488a4507b3c0fcb12605aab572086 Mon Sep 17 00:00:00 2001 From: Luo Chen Date: Mon, 2 Feb 2026 20:35:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(ServerModpackCompletionTask):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=B7=B2=E7=A6=81=E7=94=A8=E6=A8=A1=E7=BB=84=E4=BB=8D?= =?UTF-8?q?=E8=A2=AB=E4=B8=8B=E8=BD=BD=E7=9A=84=E9=97=AE=E9=A2=98=20(#5333?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmcl/mod/server/ServerModpackCompletionTask.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java index 01c31efde..0609bbab6 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java @@ -142,10 +142,14 @@ public class ServerModpackCompletionTask extends Task { } boolean download; - if (!files.containsKey(file.getPath()) || - modsDirectory.equals(actualPath.getParent()) - && Files.notExists(actualPath.resolveSibling(fileName + ModManager.DISABLED_EXTENSION)) - && Files.notExists(actualPath.resolveSibling(fileName + ModManager.OLD_EXTENSION))) { + + boolean isModDisabled = modsDirectory.equals(actualPath.getParent()) && + (Files.exists(actualPath.resolveSibling(fileName + ModManager.DISABLED_EXTENSION)) || + Files.exists(actualPath.resolveSibling(fileName + ModManager.OLD_EXTENSION))); + + if (isModDisabled) { + download = false; + } else if (!files.containsKey(file.getPath())) { // If old modpack does not have this entry, download it download = true; } else if (!Files.exists(actualPath)) {