From ff3b486f58a23c7733377206cad278c6ce5705ba Mon Sep 17 00:00:00 2001 From: Glavo Date: Wed, 10 Sep 2025 20:36:01 +0800 Subject: [PATCH] =?UTF-8?q?[release/3.6]=20=E4=BF=AE=E5=A4=8D=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E7=89=88=E6=9C=AC=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=9C=B0=E8=BF=87=E6=BB=A4=E6=8E=89=E9=83=A8=E5=88=86=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E9=97=AE=E9=A2=98=20(#4424)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/HMCL-dev/HMCL/pull/4066 https://github.com/HMCL-dev/HMCL/pull/4244 --------- Co-authored-by: Wulian233 <1055917385@qq.com> --- .../hmcl/download/game/GameRemoteVersion.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersion.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersion.java index 1bdc9913d..cb72b90fe 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersion.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersion.java @@ -24,6 +24,7 @@ import org.jackhuang.hmcl.game.ReleaseType; import org.jackhuang.hmcl.game.Version; import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.util.Immutable; +import org.jackhuang.hmcl.util.versioning.GameVersionNumber; import java.time.Instant; import java.util.List; @@ -53,10 +54,16 @@ public final class GameRemoteVersion extends RemoteVersion { @Override public int compareTo(RemoteVersion o) { - if (!(o instanceof GameRemoteVersion)) + if (!(o instanceof GameRemoteVersion)) { return 0; + } - return o.getReleaseDate().compareTo(getReleaseDate()); + int dateCompare = o.getReleaseDate().compareTo(getReleaseDate()); + if (dateCompare != 0) { + return dateCompare; + } + + return GameVersionNumber.compare(o.getSelfVersion(), getSelfVersion()); } private static Type getReleaseType(ReleaseType type) {