Skip to content

Commit c5f56ad

Browse files
committed
Fix 5963: 愚人节版本 Minecraft 2.0 的 Legacy Fabric 下载列表为空
1 parent e31268c commit c5f56ad

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

HMCLCore/src/main/java/org/jackhuang/hmcl/download/legacyfabric/LegacyFabricVersionList.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,19 @@ public Task<?> refreshAsync() {
6868
private List<String> getGameVersions(String metaUrl) throws IOException {
6969
String json = NetworkUtils.doGet(downloadProvider.injectURLWithCandidates(metaUrl));
7070
return JsonUtils.GSON.fromJson(json, listTypeOf(GameVersion.class))
71-
.stream().map(GameVersion::getVersion).collect(Collectors.toList());
71+
.stream()
72+
.map(GameVersion::getVersion)
73+
.map(LegacyFabricVersionList::normalizeGameVersion)
74+
.collect(Collectors.toList());
75+
}
76+
77+
78+
private static String normalizeGameVersion(String gameVersion) {
79+
if (gameVersion.startsWith("2point0_")) {
80+
return "2.0_" + gameVersion.substring("2point0_".length());
81+
}
82+
83+
return gameVersion;
7284
}
7385

7486
private static String getLaunchMetaUrl(String gameVersion, String loaderVersion) {

0 commit comments

Comments
 (0)