fix: breaking versions that inherit from a version being renamed

This commit is contained in:
huanghongxun
2020-04-23 12:28:11 +08:00
parent 9bda50f66e
commit bc842437fa
7 changed files with 16 additions and 8 deletions

View File

@@ -104,7 +104,7 @@ public final class HMCLModpackInstallTask extends Task<Void> {
libraryTask = libraryTask.thenComposeAsync(version -> dependency.installLibraryAsync(modpack.getGameVersion(), version, mark.getLibraryId(), mark.getLibraryVersion()));
}
dependencies.add(libraryTask.thenComposeAsync(repository::save));
dependencies.add(libraryTask.thenComposeAsync(repository::saveAsync));
}
@Override

View File

@@ -96,7 +96,7 @@ public final class UpdateInstallerWizardProvider implements WizardProvider {
}
}
return ret.thenComposeAsync(profile.getRepository()::save).thenComposeAsync(profile.getRepository().refreshVersionsAsync()).withStagesHint(stages);
return ret.thenComposeAsync(profile.getRepository()::saveAsync).thenComposeAsync(profile.getRepository().refreshVersionsAsync()).withStagesHint(stages);
}
@Override

View File

@@ -76,7 +76,7 @@ public class InstallerListPage extends ListPageBase<InstallerItem> {
}).thenAcceptAsync(analyzer -> {
Function<String, Consumer<InstallerItem>> removeAction = libraryId -> x -> {
profile.getDependency().removeLibraryAsync(version, libraryId)
.thenComposeAsync(profile.getRepository()::save)
.thenComposeAsync(profile.getRepository()::saveAsync)
.withComposeAsync(profile.getRepository().refreshVersionsAsync())
.withRunAsync(Schedulers.javafx(), () -> loadVersion(this.profile, this.versionId))
.start();
@@ -122,7 +122,7 @@ public class InstallerListPage extends ListPageBase<InstallerItem> {
private void doInstallOffline(File file) {
Task<?> task = profile.getDependency().installLibraryAsync(version, file.toPath())
.thenComposeAsync(profile.getRepository()::save)
.thenComposeAsync(profile.getRepository()::saveAsync)
.thenComposeAsync(profile.getRepository().refreshVersionsAsync());
task.setName(i18n("install.installer.install_offline"));
TaskExecutor executor = task.executor(new TaskListener() {