Add compatibility for new Minecraft version numbering

- Use ^ version range for major version 26+ instead of ~
- Match only major version for 26+ in latest compatible version lookup
This commit is contained in:
CPTProgrammer
2026-07-02 17:21:47 +08:00
parent e1ef1dd38f
commit d9df910db4
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ static String findLatestCompatibleVersion(List<String> sortedVersions, String ve
sortedVersions.findAll {
def versionList = it.tokenize(".")*.toInteger()
compareMinecraftVersion(versionList, targetVersionList) <= 0 &&
(targetVersionList[0] == versionList[0] && targetVersionList[1] == versionList[1])
(targetVersionList[0] == versionList[0] && (targetVersionList[0] >= 26 || targetVersionList[1] == versionList[1]))
}.max { a, b -> compareMinecraftVersion(a, b) }
}