summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/onesix/OneSixInstance.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-10-02 00:26:10 +0200
committerPetr Mrázek <peterix@gmail.com>2016-10-02 00:26:10 +0200
commit6e80f03409054293bdbbcd0ce87b607a811016d5 (patch)
treed64d9034d797a9c619cca4bad5ff0ef1dfb73165 /api/logic/minecraft/onesix/OneSixInstance.cpp
parent69f3ab019d4ef9e28d0c7e3c4ce3a609a6ff0a91 (diff)
downloadMultiMC-6e80f03409054293bdbbcd0ce87b607a811016d5.tar
MultiMC-6e80f03409054293bdbbcd0ce87b607a811016d5.tar.gz
MultiMC-6e80f03409054293bdbbcd0ce87b607a811016d5.tar.lz
MultiMC-6e80f03409054293bdbbcd0ce87b607a811016d5.tar.xz
MultiMC-6e80f03409054293bdbbcd0ce87b607a811016d5.zip
NOISSUE add instance-local library storage
Any libraries stored in $instanceroot/libraries/ will override the libraries from MultiMC's global folders, as long as they are marked 'local' in the json patch.
Diffstat (limited to 'api/logic/minecraft/onesix/OneSixInstance.cpp')
-rw-r--r--api/logic/minecraft/onesix/OneSixInstance.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/api/logic/minecraft/onesix/OneSixInstance.cpp b/api/logic/minecraft/onesix/OneSixInstance.cpp
index 1bf75bdb..d89a7612 100644
--- a/api/logic/minecraft/onesix/OneSixInstance.cpp
+++ b/api/logic/minecraft/onesix/OneSixInstance.cpp
@@ -145,6 +145,12 @@ QString OneSixInstance::getNativePath() const
return natives_dir.absolutePath();
}
+QString OneSixInstance::getLocalLibraryPath() const
+{
+ QDir libraries_dir(FS::PathCombine(instanceRoot(), "libraries/"));
+ return libraries_dir.absolutePath();
+}
+
QString OneSixInstance::mainJarPath() const
{
auto jarMods = getJarMods();
@@ -207,7 +213,7 @@ QString OneSixInstance::createLaunchScript(AuthSessionPtr session)
{
QStringList jars, nativeJars;
auto javaArchitecture = settings()->get("JavaArchitecture").toString();
- m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars);
+ m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars, getLocalLibraryPath());
for(auto file: jars)
{
launchScript += "cp " + file + "\n";
@@ -251,7 +257,7 @@ QStringList OneSixInstance::verboseDescription(AuthSessionPtr session)
out << "Libraries:";
QStringList jars, nativeJars;
auto javaArchitecture = settings()->get("JavaArchitecture").toString();
- m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars);
+ m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars, getLocalLibraryPath());
auto printLibFile = [&](const QString & path)
{
QFileInfo info(path);
@@ -654,7 +660,7 @@ QStringList OneSixInstance::getClassPath() const
{
QStringList jars, nativeJars;
auto javaArchitecture = settings()->get("JavaArchitecture").toString();
- m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars);
+ m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars, getLocalLibraryPath());
jars.append(mainJarPath());
return jars;
}
@@ -668,6 +674,6 @@ QStringList OneSixInstance::getNativeJars() const
{
QStringList jars, nativeJars;
auto javaArchitecture = settings()->get("JavaArchitecture").toString();
- m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars);
+ m_profile->getLibraryFiles(javaArchitecture, jars, nativeJars, getLocalLibraryPath());
return nativeJars;
}