| 307 | } |
| 308 | |
| 309 | QStringList MinecraftInstance::javaArguments() const |
| 310 | { |
| 311 | QStringList args; |
| 312 | |
| 313 | // custom args go first. we want to override them if we have our own here. |
| 314 | args.append(extraArguments()); |
| 315 | |
| 316 | // OSX dock icon and name |
| 317 | #ifdef Q_OS_MAC |
| 318 | args << "-Xdock:icon=icon.png"; |
| 319 | args << QString("-Xdock:name=\"%1\"").arg(windowTitle()); |
| 320 | #endif |
| 321 | auto traits_ = traits(); |
| 322 | // HACK: fix issues on macOS with 1.13 snapshots |
| 323 | // NOTE: Oracle Java option. if there are alternate jvm implementations, this would be the place to customize this for them |
| 324 | #ifdef Q_OS_MAC |
| 325 | if(traits_.contains("FirstThreadOnMacOS")) |
| 326 | { |
| 327 | args << QString("-XstartOnFirstThread"); |
| 328 | } |
| 329 | #endif |
| 330 | |
| 331 | // HACK: Stupid hack for Intel drivers. See: https://mojang.atlassian.net/browse/MCL-767 |
| 332 | #ifdef Q_OS_WIN32 |
| 333 | args << QString("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_" |
| 334 | "minecraft.exe.heapdump"); |
| 335 | #endif |
| 336 | |
| 337 | int min = settings()->get("MinMemAlloc").toInt(); |
| 338 | int max = settings()->get("MaxMemAlloc").toInt(); |
| 339 | if(min < max) |
| 340 | { |
| 341 | args << QString("-Xms%1m").arg(min); |
| 342 | args << QString("-Xmx%1m").arg(max); |
| 343 | } |
| 344 | else |
| 345 | { |
| 346 | args << QString("-Xms%1m").arg(max); |
| 347 | args << QString("-Xmx%1m").arg(min); |
| 348 | } |
| 349 | |
| 350 | // No PermGen in newer java. |
| 351 | JavaVersion javaVersion = getJavaVersion(); |
| 352 | if(javaVersion.requiresPermGen()) |
| 353 | { |
| 354 | auto permgen = settings()->get("PermGen").toInt(); |
| 355 | if (permgen != 64) |
| 356 | { |
| 357 | args << QString("-XX:PermSize=%1m").arg(permgen); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | args << "-Duser.language=en"; |
| 362 | |
| 363 | return args; |
| 364 | } |
| 365 | |
| 366 | QMap<QString, QString> MinecraftInstance::getVariables() const |
no test coverage detected