diff options
Diffstat (limited to 'api/logic/minecraft/onesix/OneSixVersionFormat.cpp')
-rw-r--r-- | api/logic/minecraft/onesix/OneSixVersionFormat.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/api/logic/minecraft/onesix/OneSixVersionFormat.cpp b/api/logic/minecraft/onesix/OneSixVersionFormat.cpp index 403eb112..944e68a4 100644 --- a/api/logic/minecraft/onesix/OneSixVersionFormat.cpp +++ b/api/logic/minecraft/onesix/OneSixVersionFormat.cpp @@ -51,7 +51,7 @@ VersionFilePtr OneSixVersionFormat::versionFileFromJson(const QJsonDocument &doc { if (root.contains("order")) { - out->order = requireInteger(root.value("order")); + out->setOrder(requireInteger(root.value("order"))); } else { @@ -61,7 +61,16 @@ VersionFilePtr OneSixVersionFormat::versionFileFromJson(const QJsonDocument &doc } out->name = root.value("name").toString(); - out->fileId = root.value("fileId").toString(); + + if(root.contains("uid")) + { + out->uid = root.value("uid").toString(); + } + else + { + out->uid = root.value("fileId").toString(); + } + out->version = root.value("version").toString(); out->dependsOnMinecraftVersion = root.value("mcVersion").toString(); out->filename = filename; @@ -161,10 +170,13 @@ QJsonDocument OneSixVersionFormat::versionFileToJson(const VersionFilePtr &patch QJsonObject root; if (saveOrder) { - root.insert("order", patch->order); + root.insert("order", patch->getOrder()); } writeString(root, "name", patch->name); - writeString(root, "fileId", patch->fileId); + + writeString(root, "uid", patch->uid); + writeString(root, "fileId", patch->uid); + writeString(root, "version", patch->version); writeString(root, "mcVersion", patch->dependsOnMinecraftVersion); |