New 'Platform' class

This commit is contained in:
Glavo
2021-10-13 20:14:17 +08:00
committed by Yuhui Huang
parent 9b6f2d00ca
commit dd8da57cfb
5 changed files with 78 additions and 5 deletions

View File

@@ -432,13 +432,13 @@ public final class LauncherHelper {
}
}
if (javaVersion.getPlatform() != Architecture.SYSTEM.getBits()) {
if (javaVersion.getBits() != Architecture.SYSTEM.getBits()) {
Controllers.dialog(i18n("launch.advice.different_platform"), i18n("message.warning"), MessageType.ERROR, continueAction);
suggested = true;
}
// 32-bit JVM cannot make use of too much memory.
if (javaVersion.getPlatform() == Bits.BIT_32 &&
if (javaVersion.getBits() == Bits.BIT_32 &&
setting.getMaxMemory() > 1.5 * 1024) {
// 1.5 * 1024 is an inaccurate number.
// Actual memory limit depends on operating system and memory.

View File

@@ -547,7 +547,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
Task.supplyAsync(JavaVersion::getJavas).thenAcceptAsync(Schedulers.javafx(), list -> {
List<MultiFileItem.Option<JavaVersion>> options = list.stream()
.map(javaVersion -> new MultiFileItem.Option<>(javaVersion.getVersion() + i18n("settings.game.java_directory.bit",
javaVersion.getPlatform().getBit()), javaVersion)
javaVersion.getBits().getBit()), javaVersion)
.setSubtitle(javaVersion.getBinary().toString()))
.collect(Collectors.toList());
options.add(0, javaAutoDeterminedOption);