fix(multiplayer): should not show unsupported platform when running on 32-bit Java, but 64-bit OS.
This commit is contained in:
@@ -430,7 +430,7 @@ public final class LauncherHelper {
|
||||
}
|
||||
}
|
||||
|
||||
if (javaVersion.getPlatform() != Architecture.CURRENT.getPlatform()) {
|
||||
if (javaVersion.getPlatform() != Architecture.SYSTEM.getPlatform()) {
|
||||
Controllers.dialog(i18n("launch.advice.different_platform"), i18n("message.warning"), MessageType.ERROR, continueAction);
|
||||
suggested = true;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ import org.jackhuang.hmcl.task.Schedulers;
|
||||
import org.jackhuang.hmcl.task.Task;
|
||||
import org.jackhuang.hmcl.util.Lang;
|
||||
import org.jackhuang.hmcl.util.StringUtils;
|
||||
import org.jackhuang.hmcl.util.platform.Architecture;
|
||||
import org.jackhuang.hmcl.util.platform.JavaVersion;
|
||||
import org.jackhuang.hmcl.util.platform.OperatingSystem;
|
||||
import org.jackhuang.hmcl.util.platform.Platform;
|
||||
import org.jackhuang.hmcl.util.versioning.VersionNumber;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -608,7 +608,7 @@ public final class VersionSetting implements Cloneable {
|
||||
if (checkJava)
|
||||
return JavaVersion.fromExecutable(Paths.get(getJavaDir()));
|
||||
else
|
||||
return new JavaVersion(Paths.get(getJavaDir()), "", Platform.getPlatform());
|
||||
return new JavaVersion(Paths.get(getJavaDir()), "", Architecture.SYSTEM.getPlatform());
|
||||
} catch (IOException | InvalidPathException e) {
|
||||
return null; // Custom Java Directory not found,
|
||||
}
|
||||
|
||||
@@ -228,23 +228,23 @@ public final class MultiplayerManager {
|
||||
public static String getCatoPath() {
|
||||
switch (OperatingSystem.CURRENT_OS) {
|
||||
case WINDOWS:
|
||||
if (Architecture.CURRENT == Architecture.X86_64) {
|
||||
if (Architecture.SYSTEM == Architecture.X86_64) {
|
||||
return "cato/cato/" + MultiplayerManager.CATO_VERSION + "/cato-windows-amd64.exe";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
case OSX:
|
||||
if (Architecture.CURRENT == Architecture.X86_64) {
|
||||
if (Architecture.SYSTEM == Architecture.X86_64) {
|
||||
return "cato/cato/" + MultiplayerManager.CATO_VERSION + "/cato-darwin-amd64";
|
||||
} else if (Architecture.CURRENT == Architecture.ARM64) {
|
||||
} else if (Architecture.SYSTEM == Architecture.ARM64) {
|
||||
return "cato/cato/" + MultiplayerManager.CATO_VERSION + "/cato-darwin-arm64";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
case LINUX:
|
||||
if (Architecture.CURRENT == Architecture.X86_64) {
|
||||
if (Architecture.SYSTEM == Architecture.X86_64) {
|
||||
return "cato/cato/" + MultiplayerManager.CATO_VERSION + "/cato-linux-amd64";
|
||||
} else if (Architecture.CURRENT == Architecture.ARM || Architecture.CURRENT == Architecture.ARM64) {
|
||||
} else if (Architecture.SYSTEM == Architecture.ARM || Architecture.SYSTEM == Architecture.ARM64) {
|
||||
return "cato/cato/" + MultiplayerManager.CATO_VERSION + "/cato-linux-arm7";
|
||||
} else {
|
||||
return "";
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class SelfDependencyPatcher {
|
||||
|
||||
private static String currentArchClassifier() {
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) {
|
||||
switch (Architecture.CURRENT) {
|
||||
switch (Architecture.JDK) {
|
||||
case X86_64:
|
||||
return "linux";
|
||||
case ARM:
|
||||
@@ -93,14 +93,14 @@ public final class SelfDependencyPatcher {
|
||||
return "linux-aarch64";
|
||||
}
|
||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||
switch (Architecture.CURRENT) {
|
||||
switch (Architecture.JDK) {
|
||||
case X86_64:
|
||||
return "mac";
|
||||
case ARM64:
|
||||
return "mac-aarch64";
|
||||
}
|
||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||
switch (Architecture.CURRENT) {
|
||||
switch (Architecture.JDK) {
|
||||
case X86_64:
|
||||
return "win";
|
||||
case X86:
|
||||
|
||||
Reference in New Issue
Block a user