Fix: version::compareTo compares the name, instead of the game version. (#2664)

* Fix: version.compareTo compares the name, but not the game version.

* Fix more.

* update

* update

Co-authored-by: zkitefly <z18344203426@qq.com>

---------

Co-authored-by: Glavo <zjx001202@gmail.com>
Co-authored-by: zkitefly <z18344203426@qq.com>
This commit is contained in:
Burning_TNT
2024-01-21 00:29:06 +08:00
committed by GitHub
parent 89b5b64943
commit ddcead7c85
2 changed files with 5 additions and 3 deletions

View File

@@ -256,7 +256,7 @@ public class DefaultLauncher extends Launcher {
if (StringUtils.isNotBlank(options.getServerIp())) {
String[] args = options.getServerIp().split(":");
if (version.compareTo(new Version("1.20")) < 0) {
if (VersionNumber.VERSION_COMPARATOR.compare(repository.getGameVersion(version).orElse("0.0"), "1.20") < 0) {
res.add("--server");
res.add(args[0]);
res.add("--port");