mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-18 08:16:58 -04:00
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:
parent
89b5b64943
commit
ddcead7c85
@ -25,6 +25,7 @@ import org.jackhuang.hmcl.util.Logging;
|
|||||||
import org.jackhuang.hmcl.util.i18n.I18n;
|
import org.jackhuang.hmcl.util.i18n.I18n;
|
||||||
import org.jackhuang.hmcl.util.io.FileUtils;
|
import org.jackhuang.hmcl.util.io.FileUtils;
|
||||||
import org.jackhuang.hmcl.util.platform.ManagedProcess;
|
import org.jackhuang.hmcl.util.platform.ManagedProcess;
|
||||||
|
import org.jackhuang.hmcl.util.versioning.VersionNumber;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -83,9 +84,10 @@ public final class HMCLGameLauncher extends DefaultLauncher {
|
|||||||
1.11 ~ 12:zh_cn 时正常,zh_CN 时虽然显示了中文但语言设置会错误地显示选择英文
|
1.11 ~ 12:zh_cn 时正常,zh_CN 时虽然显示了中文但语言设置会错误地显示选择英文
|
||||||
1.13+ :zh_cn 时正常,zh_CN 时自动切换为英文
|
1.13+ :zh_cn 时正常,zh_CN 时自动切换为英文
|
||||||
*/
|
*/
|
||||||
if (this.version.compareTo(new Version("1.1")) < 0) {
|
VersionNumber gameVersion = VersionNumber.asVersion(repository.getGameVersion(version).orElse("0.0"));
|
||||||
|
if (gameVersion.compareTo("1.1") < 0) {
|
||||||
lang = null;
|
lang = null;
|
||||||
} else if (this.version.compareTo(new Version("1.10")) <= 0) {
|
} else if (gameVersion.compareTo("1.11") < 0) {
|
||||||
lang = "zh_CN";
|
lang = "zh_CN";
|
||||||
} else {
|
} else {
|
||||||
lang = "zh_cn";
|
lang = "zh_cn";
|
||||||
|
@ -256,7 +256,7 @@ public class DefaultLauncher extends Launcher {
|
|||||||
|
|
||||||
if (StringUtils.isNotBlank(options.getServerIp())) {
|
if (StringUtils.isNotBlank(options.getServerIp())) {
|
||||||
String[] args = options.getServerIp().split(":");
|
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("--server");
|
||||||
res.add(args[0]);
|
res.add(args[0]);
|
||||||
res.add("--port");
|
res.add("--port");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user