From c21671e86b7bf055a804f6e6ec11db17cbe3d565 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sun, 28 Aug 2022 16:52:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E8=BF=87=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=AE=89=E8=A3=85=E6=9B=B4=E6=96=B0=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=B4=A9=E6=BA=83=20(#1662)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix game upgrade * fix #1459: Invalidate the version number cache before saving the version close #1566 --- .../jackhuang/hmcl/ui/download/AdditionalInstallersPage.java | 4 +++- .../java/org/jackhuang/hmcl/game/DefaultGameRepository.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java index 0b1aecc34..85c4e83fc 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java @@ -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); diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/DefaultGameRepository.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/DefaultGameRepository.java index 67fc5ef32..f3f9c4295 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/DefaultGameRepository.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/DefaultGameRepository.java @@ -488,6 +488,7 @@ public class DefaultGameRepository implements GameRepository { } public Task saveAsync(Version version) { + this.gameVersions.remove(getVersionJar(version)); if (version.isResolvedPreservingPatches()) { return new VersionJsonSaveTask(this, MaintainTask.maintainPreservingPatches(this, version)); } else {