summaryrefslogtreecommitdiffstats
path: root/logic/liteloader
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-07-06 11:15:15 +0200
committerPetr Mrázek <peterix@gmail.com>2014-07-06 11:15:15 +0200
commitcc499488dbab9167870e6088f9a1793f95894c79 (patch)
treed6efb25086f4c2c6cb3c0a3dc8ad5a5a80985286 /logic/liteloader
parenta218d7b7f6a9e30671be72b756104302637eb33d (diff)
downloadMultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar
MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.gz
MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.lz
MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.xz
MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.zip
Fix liteloader, some cleanups.
Diffstat (limited to 'logic/liteloader')
-rw-r--r--logic/liteloader/LiteLoaderInstaller.cpp9
-rw-r--r--logic/liteloader/LiteLoaderVersionList.cpp17
-rw-r--r--logic/liteloader/LiteLoaderVersionList.h3
3 files changed, 22 insertions, 7 deletions
diff --git a/logic/liteloader/LiteLoaderInstaller.cpp b/logic/liteloader/LiteLoaderInstaller.cpp
index ea1a4396..863c7fcb 100644
--- a/logic/liteloader/LiteLoaderInstaller.cpp
+++ b/logic/liteloader/LiteLoaderInstaller.cpp
@@ -49,13 +49,12 @@ bool LiteLoaderInstaller::add(OneSixInstance *to)
QJsonArray libraries;
- for (auto libStr : m_version->libraries)
+ for (auto rawLibrary : m_version->libraries)
{
- OneSixLibrary lib(libStr);
+ rawLibrary->insertType = RawLibrary::Prepend;
+ OneSixLibrary lib(rawLibrary);
lib.finalize();
- QJsonObject libObj = lib.toJson();
- libObj.insert("insert", QString("prepend"));
- libraries.append(libObj);
+ libraries.append(lib.toJson());
}
// liteloader
diff --git a/logic/liteloader/LiteLoaderVersionList.cpp b/logic/liteloader/LiteLoaderVersionList.cpp
index ef95eefd..c9a21cb9 100644
--- a/logic/liteloader/LiteLoaderVersionList.cpp
+++ b/logic/liteloader/LiteLoaderVersionList.cpp
@@ -16,6 +16,7 @@
#include "LiteLoaderVersionList.h"
#include "MultiMC.h"
#include "logic/net/URLConstants.h"
+#include <MMCError.h>
#include <QtXml>
@@ -206,7 +207,21 @@ void LLListLoadTask::listDownloaded()
const QJsonArray libs = artefact.value("libraries").toArray();
for (auto lIt = libs.begin(); lIt != libs.end(); ++lIt)
{
- version->libraries.append((*lIt).toObject().value("name").toString());
+ auto libobject = (*lIt).toObject();
+ try
+ {
+ auto lib = RawLibrary::fromJson(libobject, "versions.json");
+ if(lib->m_name.startsWith("org.ow2.asm:asm-all:"))
+ {
+ lib->m_base_url = "http://repo.maven.apache.org/maven2/";
+ }
+ version->libraries.append(lib);
+ }
+ catch (MMCError &e)
+ {
+ QLOG_ERROR() << "Couldn't read JSON object:";
+ continue;
+ }
}
perMcVersionList.append(version);
}
diff --git a/logic/liteloader/LiteLoaderVersionList.h b/logic/liteloader/LiteLoaderVersionList.h
index 0aecc3e1..91ed077c 100644
--- a/logic/liteloader/LiteLoaderVersionList.h
+++ b/logic/liteloader/LiteLoaderVersionList.h
@@ -23,6 +23,7 @@
#include "logic/BaseVersionList.h"
#include "logic/tasks/Task.h"
#include "logic/net/NetJob.h"
+#include <logic/minecraft/RawLibrary.h>
class LLListLoadTask;
class QNetworkReply;
@@ -55,7 +56,7 @@ public:
int timestamp;
bool isLatest;
QString tweakClass;
- QStringList libraries;
+ QList<RawLibraryPtr> libraries;
// meta
QString defaultUrl;