| 472 | } |
| 473 | |
| 474 | QStringList MinecraftInstance::javaArguments() |
| 475 | { |
| 476 | QStringList args; |
| 477 | |
| 478 | // custom args go first. we want to override them if we have our own here. |
| 479 | args.append(extraArguments()); |
| 480 | |
| 481 | // OSX dock icon and name |
| 482 | #ifdef Q_OS_MAC |
| 483 | args << "-Xdock:icon=icon.png"; |
| 484 | args << QString("-Xdock:name=\"%1\"").arg(windowTitle()); |
| 485 | #endif |
| 486 | auto traits_ = traits(); |
| 487 | // HACK: fix issues on macOS with 1.13 snapshots |
| 488 | // NOTE: Oracle Java option. if there are alternate jvm implementations, this would be the place to customize this for them |
| 489 | #ifdef Q_OS_MAC |
| 490 | if (traits_.contains("FirstThreadOnMacOS")) { |
| 491 | args << QString("-XstartOnFirstThread"); |
| 492 | } |
| 493 | #endif |
| 494 | |
| 495 | // HACK: Stupid hack for Intel drivers. See: https://mojang.atlassian.net/browse/MCL-767 |
| 496 | #ifdef Q_OS_WIN32 |
| 497 | args << QString( |
| 498 | "-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_" |
| 499 | "minecraft.exe.heapdump"); |
| 500 | #endif |
| 501 | |
| 502 | int min = settings()->get("MinMemAlloc").toInt(); |
| 503 | int max = settings()->get("MaxMemAlloc").toInt(); |
| 504 | if (min < max) { |
| 505 | args << QString("-Xms%1m").arg(min); |
| 506 | args << QString("-Xmx%1m").arg(max); |
| 507 | } else { |
| 508 | args << QString("-Xms%1m").arg(max); |
| 509 | args << QString("-Xmx%1m").arg(min); |
| 510 | } |
| 511 | |
| 512 | // No PermGen in newer java. |
| 513 | JavaVersion javaVersion = getJavaVersion(); |
| 514 | if (javaVersion.requiresPermGen()) { |
| 515 | auto permgen = settings()->get("PermGen").toInt(); |
| 516 | if (permgen != 64) { |
| 517 | args << QString("-XX:PermSize=%1m").arg(permgen); |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | args << "-Duser.language=en"; |
| 522 | |
| 523 | if (javaVersion.isModular() && shouldApplyOnlineFixes()) |
| 524 | // allow reflective access to java.net - required by the skin fix |
| 525 | args << "--add-opens" << "java.base/java.net=ALL-UNNAMED"; |
| 526 | |
| 527 | return args; |
| 528 | } |
| 529 | |
| 530 | QString MinecraftInstance::getLauncher() |
| 531 | { |
no test coverage detected