From 77a1d39f6b623ede3e8ce9245459e0f864a1d176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 22 Apr 2017 05:20:06 +0200 Subject: NOISSUE fix problems in old curse packs Added: * jarmod importing * fixing of bad minecraft versions * mapping of undefined 'recommended' forge versions to something appropriate * some fake guessing of pack icons * fixes for some more issues found with the pack manifest format --- api/logic/minecraft/curse/PackManifest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'api/logic/minecraft/curse') diff --git a/api/logic/minecraft/curse/PackManifest.cpp b/api/logic/minecraft/curse/PackManifest.cpp index 2fde8a01..7d9c2f89 100644 --- a/api/logic/minecraft/curse/PackManifest.cpp +++ b/api/logic/minecraft/curse/PackManifest.cpp @@ -18,7 +18,8 @@ static void loadModloaderV1(Curse::Modloader & m, QJsonObject & modLoader) static void loadMinecraftV1(Curse::Minecraft & m, QJsonObject & minecraft) { m.version = Json::requireString(minecraft, "version"); - // FIXME: default unknown, assuming empty. Meaning also unknown. + // extra libraries... apparently only used for a custom Minecraft launcher in the 1.2.5 FTB retro pack + // intended use is likely hardcoded in the Curse client, the manifest says nothing m.libraries = Json::ensureString(minecraft, QString("libraries"), QString()); auto arr = Json::ensureArray(minecraft, "modLoaders", QJsonArray()); for (const auto & item : arr) @@ -34,9 +35,9 @@ static void loadManifestV1(Curse::Manifest & m, QJsonObject & manifest) { auto mc = Json::requireObject(manifest, "minecraft"); loadMinecraftV1(m.minecraft, mc); - m.name = Json::requireString(manifest, "name"); - m.version = Json::requireString(manifest, "version"); - m.author = Json::requireString(manifest, "author"); + m.name = Json::ensureString(manifest, QString("name"), "Unnamed"); + m.version = Json::ensureString(manifest, QString("version"), QString()); + m.author = Json::ensureString(manifest, QString("author"), "Anonymous Coward"); auto arr = Json::ensureArray(manifest, "files", QJsonArray()); for (const auto & item : arr) { -- cgit v1.2.3