修复 #3127 1.21 NeoForge 下载问题 (#3128)

This commit is contained in:
Burning_TNT 2024-07-20 01:57:04 +08:00 committed by GitHub
parent b7a5b484b5
commit 0782f40fe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,9 @@ public final class NeoForgeOfficialVersionList extends VersionList<NeoForgeRemot
}
for (String version : results[1].versions) {
String mcVersion = "1." + version.substring(0, version.indexOf('.', version.indexOf('.') + 1));
int si1 = version.indexOf('.'), si2 = version.indexOf('.', version.indexOf('.') + 1);
String mcVersion = "1." + version.substring(0, Integer.parseInt(version.substring(si1 + 1, si2)) == 0 ? si1 : si2);
versions.put(mcVersion, new NeoForgeRemoteVersion(
mcVersion, NeoForgeRemoteVersion.normalize(version),
Collections.singletonList(