From 0e345543446e38f5bbde76ac5f1bc8bc1dd2eff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Sun, 6 Sep 2026 20:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=8C=96=20OptiFineVersion=20?= =?UTF-8?q?=E4=B8=BA=20Record=20(#6821)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../optifine/OptiFineBMCLVersionList.java | 80 +++---------------- 1 file changed, 11 insertions(+), 69 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/download/optifine/OptiFineBMCLVersionList.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/download/optifine/OptiFineBMCLVersionList.java index 4ec3b8d193..24d1c67c3b 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/download/optifine/OptiFineBMCLVersionList.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/download/optifine/OptiFineBMCLVersionList.java @@ -22,6 +22,7 @@ import org.jackhuang.hmcl.download.ComponentVersionList; import org.jackhuang.hmcl.task.GetTask; import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.util.StringUtils; +import org.jackhuang.hmcl.util.gson.JsonSerializable; import org.jackhuang.hmcl.util.versioning.VersionNumber; import java.util.Collections; @@ -79,17 +80,17 @@ public final class OptiFineBMCLVersionList extends ComponentVersionList duplicates = new HashSet<>(); for (OptiFineVersion element : root) { - String version = element.getType() + "_" + element.getPatch(); - String mirror = apiRoot + "/optifine/" + toLookupVersion(element.getGameVersion()) + "/" + element.getType() + "/" + element.getPatch(); + String version = element.type() + "_" + element.patch(); + String mirror = apiRoot + "/optifine/" + toLookupVersion(element.gameVersion()) + "/" + element.type() + "/" + element.patch(); if (!duplicates.add(mirror)) continue; - boolean isPre = element.getPatch() != null && (element.getPatch().startsWith("pre") || element.getPatch().startsWith("alpha")); + boolean isPre = element.patch() != null && (element.patch().startsWith("pre") || element.patch().startsWith("alpha")); - if (StringUtils.isBlank(element.getGameVersion())) + if (StringUtils.isBlank(element.gameVersion())) continue; - String gameVersion = VersionNumber.normalize(fromLookupVersion(element.getGameVersion())); + String gameVersion = VersionNumber.normalize(fromLookupVersion(element.gameVersion())); versions.put(gameVersion, new OptiFineRemoteVersion(gameVersion, version, Collections.singletonList(mirror), isPre)); } } finally { @@ -97,73 +98,14 @@ public final class OptiFineBMCLVersionList extends ComponentVersionList