From d587720010036e3335e321f192449808a75e958b Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Mon, 21 Mar 2016 02:19:23 +0100 Subject: NOISSUE use new mojang assets locations --- logic/minecraft/MojangVersionFormat.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'logic/minecraft/MojangVersionFormat.cpp') diff --git a/logic/minecraft/MojangVersionFormat.cpp b/logic/minecraft/MojangVersionFormat.cpp index 779a2b7d..41723493 100644 --- a/logic/minecraft/MojangVersionFormat.cpp +++ b/logic/minecraft/MojangVersionFormat.cpp @@ -157,11 +157,15 @@ void MojangVersionFormat::readVersionProperties(const QJsonObject &in, VersionFi } Bits::readString(in, "type", out->type); + Bits::readString(in, "assets", out->assets); if(in.contains("assetIndex")) { out->mojangAssetIndex = assetIndexFromJson(requireObject(in, "assetIndex")); } - Bits::readString(in, "assets", out->assets); + else if (!out->assets.isNull()) + { + out->mojangAssetIndex = std::make_shared(out->assets); + } out->m_releaseTime = timeFromS3Time(in.value("releaseTime").toString("")); out->m_updateTime = timeFromS3Time(in.value("time").toString("")); @@ -231,7 +235,6 @@ void MojangVersionFormat::writeVersionProperties(const VersionFile* in, QJsonObj writeString(out, "mainClass", in->mainClass); writeString(out, "minecraftArguments", in->minecraftArguments); writeString(out, "type", in->type); - writeString(out, "assets", in->assets); if(!in->m_releaseTime.isNull()) { writeString(out, "releaseTime", timeToS3Time(in->m_releaseTime)); @@ -244,6 +247,7 @@ void MojangVersionFormat::writeVersionProperties(const VersionFile* in, QJsonObj { out.insert("minimumLauncherVersion", in->minimumLauncherVersion); } + writeString(out, "assets", in->assets); if(in->mojangAssetIndex && in->mojangAssetIndex->known) { out.insert("assetIndex", assetIndexToJson(in->mojangAssetIndex)); -- cgit