Skip to content

Commit 5e42652

Browse files
GlavoCiiLu
andauthored
[release/3.9] 更新 NeoForge 版本号规则 (#5229)
#5110 Co-authored-by: 辞庐 <109708109+CiiLu@users.noreply.github.com>
1 parent 9f682e0 commit 5e42652

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeOfficialVersionList.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ public Task<?> refreshAsync() {
6363
if (majorVersion == 0) { // Snapshot version.
6464
mcVersion = version.substring(si1 + 1, si2);
6565
} else {
66-
mcVersion = "1." + version.substring(0, Integer.parseInt(version.substring(si1 + 1, si2)) == 0 ? si1 : si2);
66+
String ver = version.substring(0, Integer.parseInt(version.substring(si1 + 1, si2)) == 0 ? si1 : si2);
67+
if (majorVersion >= 26) {
68+
int separator = version.indexOf('+');
69+
mcVersion = separator < 0 ? ver : ver + "-" + version.substring(separator + 1);
70+
} else {
71+
mcVersion = "1." + ver;
72+
}
6773
}
6874
} catch (RuntimeException e) {
6975
LOG.warning(String.format("Cannot parse NeoForge version %s for cracking its mc version.", version), e);

0 commit comments

Comments
 (0)