2015-01-27 21:31:07 +00:00
|
|
|
#include "MinecraftInstance.h"
|
2015-02-09 00:51:14 +00:00
|
|
|
#include "settings/SettingsObject.h"
|
2015-01-27 21:31:07 +00:00
|
|
|
#include <pathutils.h>
|
2015-02-09 00:51:14 +00:00
|
|
|
#include "Env.h"
|
|
|
|
#include "minecraft/MinecraftVersionList.h"
|
2015-01-27 21:31:07 +00:00
|
|
|
|
2015-02-01 02:08:25 +00:00
|
|
|
MinecraftInstance::MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir)
|
|
|
|
: BaseInstance(globalSettings, settings, rootDir)
|
2015-01-27 21:31:07 +00:00
|
|
|
{
|
|
|
|
// Java Settings
|
|
|
|
m_settings->registerSetting("OverrideJava", false);
|
2015-05-04 00:20:48 +01:00
|
|
|
auto locationOverride = m_settings->registerSetting("OverrideJavaLocation", false);
|
2015-01-27 21:31:07 +00:00
|
|
|
m_settings->registerSetting("OverrideJavaArgs", false);
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("JavaPath"));
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("JvmArgs"));
|
|
|
|
|
2015-05-04 00:20:48 +01:00
|
|
|
// special!
|
|
|
|
m_settings->registerPassthrough(globalSettings->getSetting("JavaTimestamp"), locationOverride);
|
|
|
|
m_settings->registerPassthrough(globalSettings->getSetting("JavaVersion"), locationOverride);
|
|
|
|
|
2015-01-27 21:31:07 +00:00
|
|
|
// Window Size
|
|
|
|
m_settings->registerSetting("OverrideWindow", false);
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("LaunchMaximized"));
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("MinecraftWinWidth"));
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("MinecraftWinHeight"));
|
|
|
|
|
|
|
|
// Memory
|
|
|
|
m_settings->registerSetting("OverrideMemory", false);
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("MinMemAlloc"));
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("MaxMemAlloc"));
|
|
|
|
m_settings->registerOverride(globalSettings->getSetting("PermGen"));
|
|
|
|
}
|
|
|
|
|
|
|
|
QString MinecraftInstance::minecraftRoot() const
|
|
|
|
{
|
|
|
|
QFileInfo mcDir(PathCombine(instanceRoot(), "minecraft"));
|
|
|
|
QFileInfo dotMCDir(PathCombine(instanceRoot(), ".minecraft"));
|
|
|
|
|
|
|
|
if (dotMCDir.exists() && !mcDir.exists())
|
|
|
|
return dotMCDir.filePath();
|
|
|
|
else
|
|
|
|
return mcDir.filePath();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr< BaseVersionList > MinecraftInstance::versionList() const
|
|
|
|
{
|
2015-02-02 00:09:28 +00:00
|
|
|
return ENV.getVersionList("net.minecraft");
|
2015-01-27 21:31:07 +00:00
|
|
|
}
|