修复通过自动安装更新游戏时的崩溃 (#1662)

* fix game upgrade

* fix #1459: Invalidate the version number cache before saving the version
close #1566
This commit is contained in:
Glavo authored and GitHub committed 2022-08-28 16:52:26 +08:00
1 parent d9bdc2b1f7
commit c21671e86b
2 files changed
+4 -1

No files matched your search

@@ -91,9 +91,11 @@ class AdditionalInstallersPage extends InstallersPage {
String optiFine = analyzer.getVersion(OPTIFINE).orElse(null);
String fabric = analyzer.getVersion(FABRIC).orElse(null);
String fabricApi = analyzer.getVersion(FABRIC_API).orElse(null);
String quilt = analyzer.getVersion(QUILT).orElse(null);
String quiltApi = analyzer.getVersion(QUILT_API).orElse(null);
InstallerItem[] libraries = group.getLibraries();
String[] versions = new String[]{game, forge, liteLoader, optiFine, fabric, fabricApi};
String[] versions = new String[]{game, forge, liteLoader, optiFine, fabric, fabricApi, quilt, quiltApi};
String currentGameVersion = Lang.nonNull(getVersion("game"), game);
@@ -488,6 +488,7 @@ public class DefaultGameRepository implements GameRepository {
}
public Task<Version> saveAsync(Version version) {
this.gameVersions.remove(getVersionJar(version));
if (version.isResolvedPreservingPatches()) {
return new VersionJsonSaveTask(this, MaintainTask.maintainPreservingPatches(this, version));
} else {