aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/launch
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/launch')
-rw-r--r--launcher/minecraft/launch/DirectJavaLaunch.cpp4
-rw-r--r--launcher/minecraft/launch/LauncherPartLaunch.cpp27
2 files changed, 26 insertions, 5 deletions
diff --git a/launcher/minecraft/launch/DirectJavaLaunch.cpp b/launcher/minecraft/launch/DirectJavaLaunch.cpp
index 152485b3..ca55cd2e 100644
--- a/launcher/minecraft/launch/DirectJavaLaunch.cpp
+++ b/launcher/minecraft/launch/DirectJavaLaunch.cpp
@@ -21,6 +21,8 @@
#include <FileSystem.h>
#include <Commandline.h>
+#include "Application.h"
+
#ifdef Q_OS_LINUX
#include "gamemode_client.h"
#endif
@@ -86,7 +88,7 @@ void DirectJavaLaunch::executeTask()
}
#ifdef Q_OS_LINUX
- if (instance->settings()->get("EnableFeralGamemode").toBool())
+ if (instance->settings()->get("EnableFeralGamemode").toBool() && APPLICATION->capabilities() & Application::SupportsGameMode)
{
auto pid = m_process.processId();
if (pid)
diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp
index 3b905bf5..ce477ad7 100644
--- a/launcher/minecraft/launch/LauncherPartLaunch.cpp
+++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp
@@ -95,8 +95,8 @@ bool fitsInLocal8bit(const QString & string)
void LauncherPartLaunch::executeTask()
{
- QString newLaunchJar = APPLICATION->getJarPath("NewLaunch.jar");
- if (newLaunchJar.isEmpty())
+ QString jarPath = APPLICATION->getJarPath("NewLaunch.jar");
+ if (jarPath.isEmpty())
{
const char *reason = QT_TR_NOOP("Launcher library could not be found. Please check your installation.");
emit logLine(tr(reason), MessageLevel::Fatal);
@@ -119,6 +119,9 @@ void LauncherPartLaunch::executeTask()
// make detachable - this will keep the process running even if the object is destroyed
m_process.setDetachable(true);
+ auto classPath = minecraftInstance->getClassPath();
+ classPath.prepend(jarPath);
+
auto natPath = minecraftInstance->getNativePath();
#ifdef Q_OS_WIN
if (!fitsInLocal8bit(natPath))
@@ -134,7 +137,23 @@ void LauncherPartLaunch::executeTask()
#endif
args << "-cp";
- args << newLaunchJar;
+#ifdef Q_OS_WIN
+ QStringList processed;
+ for(auto & item: classPath)
+ {
+ if (!fitsInLocal8bit(item))
+ {
+ processed << shortPathName(item);
+ }
+ else
+ {
+ processed << item;
+ }
+ }
+ args << processed.join(';');
+#else
+ args << classPath.join(':');
+#endif
args << "org.polymc.EntryPoint";
qDebug() << args.join(' ');
@@ -162,7 +181,7 @@ void LauncherPartLaunch::executeTask()
}
#ifdef Q_OS_LINUX
- if (instance->settings()->get("EnableFeralGamemode").toBool())
+ if (instance->settings()->get("EnableFeralGamemode").toBool() && APPLICATION->capabilities() & Application::SupportsGameMode)
{
auto pid = m_process.processId();
if (pid)