|
51 | 51 | import java.nio.file.Files; |
52 | 52 | import java.nio.file.Path; |
53 | 53 | import java.nio.file.Paths; |
54 | | -import java.util.*; |
| 54 | +import java.util.List; |
| 55 | +import java.util.Map; |
| 56 | +import java.util.Objects; |
| 57 | +import java.util.Optional; |
55 | 58 | import java.util.stream.Stream; |
56 | 59 |
|
57 | 60 | import static org.jackhuang.hmcl.util.Lang.mapOf; |
@@ -167,7 +170,7 @@ public static Task<?> getInstallTask(Profile profile, ServerModpackManifest mani |
167 | 170 |
|
168 | 171 | return new ServerModpackRemoteInstallTask(profile.getDependency(), manifest, name) |
169 | 172 | .whenComplete(Schedulers.defaultScheduler(), success, failure) |
170 | | - .withStagesHints("hmcl.modpack", "hmcl.modpack.download"); |
| 173 | + .withStagesHints(new Task.StagesHint("hmcl.modpack"), new Task.StagesHint("hmcl.modpack.download", List.of("hmcl.install.assets", "hmcl.install.libraries"))); |
171 | 174 | } |
172 | 175 |
|
173 | 176 | public static boolean isExternalGameNameConflicts(String name) { |
@@ -211,24 +214,24 @@ public static Task<?> getInstallTask(Profile profile, Path zipFile, String name, |
211 | 214 | return modpack.getInstallTask(profile.getDependency(), zipFile, name, iconUrl) |
212 | 215 | .whenComplete(Schedulers.defaultScheduler(), success, failure) |
213 | 216 | .thenComposeAsync(createMultiMCPostInstallTask(profile, (MultiMCInstanceConfiguration) modpack.getManifest(), name)) |
214 | | - .withStagesHints("hmcl.modpack", "hmcl.modpack.download"); |
| 217 | + .withStagesHints(new Task.StagesHint("hmcl.modpack"), new Task.StagesHint("hmcl.modpack.download", List.of("hmcl.install.assets", "hmcl.install.libraries"))); |
215 | 218 | else if (modpack.getManifest() instanceof McbbsModpackManifest) |
216 | 219 | return modpack.getInstallTask(profile.getDependency(), zipFile, name, iconUrl) |
217 | 220 | .whenComplete(Schedulers.defaultScheduler(), success, failure) |
218 | 221 | .thenComposeAsync(createMcbbsPostInstallTask(profile, (McbbsModpackManifest) modpack.getManifest(), name)) |
219 | | - .withStagesHints("hmcl.modpack", "hmcl.modpack.download"); |
| 222 | + .withStagesHints(new Task.StagesHint("hmcl.modpack"), new Task.StagesHint("hmcl.modpack.download", List.of("hmcl.install.assets", "hmcl.install.libraries"))); |
220 | 223 | else |
221 | 224 | return modpack.getInstallTask(profile.getDependency(), zipFile, name, iconUrl) |
222 | 225 | .whenComplete(Schedulers.javafx(), success, failure) |
223 | | - .withStagesHints("hmcl.modpack", "hmcl.modpack.download"); |
| 226 | + .withStagesHints(new Task.StagesHint("hmcl.modpack"), new Task.StagesHint("hmcl.modpack.download", List.of("hmcl.install.assets", "hmcl.install.libraries"))); |
224 | 227 | } |
225 | 228 |
|
226 | 229 | public static Task<Void> getUpdateTask(Profile profile, ServerModpackManifest manifest, Charset charset, String name, ModpackConfiguration<?> configuration) throws UnsupportedModpackException { |
227 | 230 | switch (configuration.getType()) { |
228 | 231 | case ServerModpackRemoteInstallTask.MODPACK_TYPE: |
229 | 232 | return new ModpackUpdateTask(profile.getRepository(), name, new ServerModpackRemoteInstallTask(profile.getDependency(), manifest, name)) |
230 | 233 | .thenComposeAsync(profile.getRepository().refreshVersionsAsync()) |
231 | | - .withStagesHints("hmcl.modpack", "hmcl.modpack.download"); |
| 234 | + .withStagesHints(new Task.StagesHint("hmcl.modpack"), new Task.StagesHint("hmcl.modpack.download", List.of("hmcl.install.assets", "hmcl.install.libraries"))); |
232 | 235 | default: |
233 | 236 | throw new UnsupportedModpackException(); |
234 | 237 | } |
|
0 commit comments