Skip to content

Commit 0fc8222

Browse files
authored
fix(ServerModpackCompletionTask): 修复已禁用模组仍被下载的问题 (#5333)
1 parent 5c2bb1c commit 0fc8222

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,14 @@ public void execute() throws Exception {
142142
}
143143

144144
boolean download;
145-
if (!files.containsKey(file.getPath()) ||
146-
modsDirectory.equals(actualPath.getParent())
147-
&& Files.notExists(actualPath.resolveSibling(fileName + ModManager.DISABLED_EXTENSION))
148-
&& Files.notExists(actualPath.resolveSibling(fileName + ModManager.OLD_EXTENSION))) {
145+
146+
boolean isModDisabled = modsDirectory.equals(actualPath.getParent()) &&
147+
(Files.exists(actualPath.resolveSibling(fileName + ModManager.DISABLED_EXTENSION)) ||
148+
Files.exists(actualPath.resolveSibling(fileName + ModManager.OLD_EXTENSION)));
149+
150+
if (isModDisabled) {
151+
download = false;
152+
} else if (!files.containsKey(file.getPath())) {
149153
// If old modpack does not have this entry, download it
150154
download = true;
151155
} else if (!Files.exists(actualPath)) {

0 commit comments

Comments
 (0)