From b37ec8dd1fba35b775b359684c0e446250f69c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=AE=87?= <63290381+xiaoyv404@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:06:08 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20#4278:=20=E6=9B=B4=E6=96=B0=E6=95=B4?= =?UTF-8?q?=E5=90=88=E5=8C=85=E5=90=8E=E5=88=B7=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=20(#5536)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #4278 --- .../main/java/org/jackhuang/hmcl/game/ModpackHelper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/game/ModpackHelper.java b/HMCL/src/main/java/org/jackhuang/hmcl/game/ModpackHelper.java index de71d44e7..9acd849d5 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/game/ModpackHelper.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/game/ModpackHelper.java @@ -227,6 +227,7 @@ public final class ModpackHelper { switch (configuration.getType()) { case ServerModpackRemoteInstallTask.MODPACK_TYPE: return new ModpackUpdateTask(profile.getRepository(), name, new ServerModpackRemoteInstallTask(profile.getDependency(), manifest, name)) + .thenComposeAsync(profile.getRepository().refreshVersionsAsync()) .withStagesHint(Arrays.asList("hmcl.modpack", "hmcl.modpack.download")); default: throw new UnsupportedModpackException(); @@ -241,9 +242,11 @@ public final class ModpackHelper { } if (modpack.getManifest() instanceof MultiMCInstanceConfiguration) return provider.createUpdateTask(profile.getDependency(), name, zipFile, modpack) - .thenComposeAsync(() -> createMultiMCPostUpdateTask(profile, (MultiMCInstanceConfiguration) modpack.getManifest(), name)); + .thenComposeAsync(() -> createMultiMCPostUpdateTask(profile, (MultiMCInstanceConfiguration) modpack.getManifest(), name)) + .thenComposeAsync(profile.getRepository().refreshVersionsAsync()); else - return provider.createUpdateTask(profile.getDependency(), name, zipFile, modpack); + return provider.createUpdateTask(profile.getDependency(), name, zipFile, modpack) + .thenComposeAsync(profile.getRepository().refreshVersionsAsync()); } public static void toVersionSetting(MultiMCInstanceConfiguration c, VersionSetting vs) {