summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/JarMod.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/minecraft/JarMod.cpp')
-rw-r--r--logic/minecraft/JarMod.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/logic/minecraft/JarMod.cpp b/logic/minecraft/JarMod.cpp
index 99a30aa5..18a9411c 100644
--- a/logic/minecraft/JarMod.cpp
+++ b/logic/minecraft/JarMod.cpp
@@ -1,5 +1,6 @@
#include "JarMod.h"
#include "logic/MMCJson.h"
+using namespace MMCJson;
JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename)
{
@@ -28,6 +29,7 @@ JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename)
};
readString("url", out->baseurl);
+ readString("MMC-hint", out->hint);
readString("MMC-absoluteUrl", out->absoluteUrl);
if(!out->baseurl.isEmpty() && out->absoluteUrl.isEmpty())
{
@@ -36,6 +38,16 @@ JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename)
return out;
}
+QJsonObject Jarmod::toJson()
+{
+ QJsonObject out;
+ writeString(out, "name", name);
+ writeString(out, "url", baseurl);
+ writeString(out, "MMC-absoluteUrl", absoluteUrl);
+ writeString(out, "MMC-hint", hint);
+ return out;
+}
+
QString Jarmod::url()
{
if(!absoluteUrl.isEmpty())