summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/MinecraftProfile.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-03-21 02:19:23 +0100
committerPetr Mrázek <peterix@gmail.com>2016-03-26 17:05:27 +0100
commitd587720010036e3335e321f192449808a75e958b (patch)
treeda8bafcd9638be6db9f1752c1a475a9099996591 /logic/minecraft/MinecraftProfile.cpp
parent2929ca74134758bf473cdf6184a045aa863b07cf (diff)
downloadMultiMC-d587720010036e3335e321f192449808a75e958b.tar
MultiMC-d587720010036e3335e321f192449808a75e958b.tar.gz
MultiMC-d587720010036e3335e321f192449808a75e958b.tar.lz
MultiMC-d587720010036e3335e321f192449808a75e958b.tar.xz
MultiMC-d587720010036e3335e321f192449808a75e958b.zip
NOISSUE use new mojang assets locations
Diffstat (limited to 'logic/minecraft/MinecraftProfile.cpp')
-rw-r--r--logic/minecraft/MinecraftProfile.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/logic/minecraft/MinecraftProfile.cpp b/logic/minecraft/MinecraftProfile.cpp
index 5fd700f2..71ece012 100644
--- a/logic/minecraft/MinecraftProfile.cpp
+++ b/logic/minecraft/MinecraftProfile.cpp
@@ -62,7 +62,7 @@ void MinecraftProfile::clear()
{
m_minecraftVersion.clear();
m_minecraftVersionType.clear();
- m_minecraftAssets.clear();
+ m_minecraftAssets.reset();
m_minecraftArguments.clear();
m_tweakers.clear();
m_mainClass.clear();
@@ -420,9 +420,12 @@ void MinecraftProfile::applyMinecraftVersionType(const QString& type)
applyString(type, this->m_minecraftVersionType);
}
-void MinecraftProfile::applyMinecraftAssets(const QString& assets)
+void MinecraftProfile::applyMinecraftAssets(MojangAssetIndexInfo::Ptr assets)
{
- applyString(assets, this->m_minecraftAssets);
+ if(assets)
+ {
+ m_minecraftAssets = assets;
+ }
}
void MinecraftProfile::applyTraits(const QSet<QString>& traits)
@@ -544,18 +547,11 @@ QString MinecraftProfile::getMinecraftVersionType() const
return m_minecraftVersionType;
}
-QString MinecraftProfile::getMinecraftAssets() const
+std::shared_ptr<MojangAssetIndexInfo> MinecraftProfile::getMinecraftAssets() const
{
- // HACK: deny april fools. my head hurts enough already.
- QDate now = QDate::currentDate();
- bool isAprilFools = now.month() == 4 && now.day() == 1;
- if (m_minecraftAssets.endsWith("_af") && !isAprilFools)
- {
- return m_minecraftAssets.left(m_minecraftAssets.length() - 3);
- }
- if (m_minecraftAssets.isEmpty())
+ if(!m_minecraftAssets)
{
- return QLatin1Literal("legacy");
+ return std::make_shared<MojangAssetIndexInfo>("legacy");
}
return m_minecraftAssets;
}