Fix #4278: 更新整合包后刷新版本号 (#5536)

fix #4278
This commit is contained in:
小宇
2026-02-15 22:06:08 +08:00
committed by GitHub
parent 167577b9c6
commit b37ec8dd1f

View File

@@ -227,6 +227,7 @@ public final class ModpackHelper {
switch (configuration.getType()) { switch (configuration.getType()) {
case ServerModpackRemoteInstallTask.MODPACK_TYPE: case ServerModpackRemoteInstallTask.MODPACK_TYPE:
return new ModpackUpdateTask(profile.getRepository(), name, new ServerModpackRemoteInstallTask(profile.getDependency(), manifest, name)) return new ModpackUpdateTask(profile.getRepository(), name, new ServerModpackRemoteInstallTask(profile.getDependency(), manifest, name))
.thenComposeAsync(profile.getRepository().refreshVersionsAsync())
.withStagesHint(Arrays.asList("hmcl.modpack", "hmcl.modpack.download")); .withStagesHint(Arrays.asList("hmcl.modpack", "hmcl.modpack.download"));
default: default:
throw new UnsupportedModpackException(); throw new UnsupportedModpackException();
@@ -241,9 +242,11 @@ public final class ModpackHelper {
} }
if (modpack.getManifest() instanceof MultiMCInstanceConfiguration) if (modpack.getManifest() instanceof MultiMCInstanceConfiguration)
return provider.createUpdateTask(profile.getDependency(), name, zipFile, modpack) 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 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) { public static void toVersionSetting(MultiMCInstanceConfiguration c, VersionSetting vs) {