summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/MinecraftProfile.cpp
diff options
context:
space:
mode:
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;
}