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

* fix game upgrade

* fix #1459: Invalidate the version number cache before saving the version
close #1566
This commit is contained in:
Glavo 2022-08-28 16:52:26 +08:00 committed by GitHub
parent d9bdc2b1f7
commit c21671e86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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 {