diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
commit | 795889d934e8f4ebe89be1a49a3417fd98e89be1 (patch) | |
tree | c5b0d30d425003c4b88e84a2908e63eb5ed797b9 /api/logic/minecraft/VersionFile.cpp | |
parent | 160b5033a79e6b5ee9f3e2a001b96c677f41ddcb (diff) | |
parent | 8e58d61150b0bdbe9eb91065d36342f3004fe97b (diff) | |
download | PrismLauncher-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.gz PrismLauncher-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.bz2 PrismLauncher-795889d934e8f4ebe89be1a49a3417fd98e89be1.zip |
Merge branch 'feature/meta' into develop
Diffstat (limited to 'api/logic/minecraft/VersionFile.cpp')
-rw-r--r-- | api/logic/minecraft/VersionFile.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/api/logic/minecraft/VersionFile.cpp b/api/logic/minecraft/VersionFile.cpp index 573c4cb4..b261ff2a 100644 --- a/api/logic/minecraft/VersionFile.cpp +++ b/api/logic/minecraft/VersionFile.cpp @@ -12,37 +12,28 @@ #include "VersionBuildError.h" #include <Version.h> -bool VersionFile::isMinecraftVersion() +static bool isMinecraftVersion(const QString &uid) { - return fileId == "net.minecraft"; -} - -bool VersionFile::hasJarMods() -{ - return !jarMods.isEmpty(); + return uid == "net.minecraft"; } void VersionFile::applyTo(MinecraftProfile *profile) { - auto theirVersion = profile->getMinecraftVersion(); - if (!theirVersion.isNull() && !dependsOnMinecraftVersion.isNull()) + // Only real Minecraft can set those. Don't let anything override them. + if (isMinecraftVersion(uid)) { - if (QRegExp(dependsOnMinecraftVersion, Qt::CaseInsensitive, QRegExp::Wildcard).indexIn(theirVersion) == -1) - { - throw MinecraftVersionMismatch(fileId, dependsOnMinecraftVersion, theirVersion); - } + profile->applyMinecraftVersion(minecraftVersion); + profile->applyMinecraftVersionType(type); + // HACK: ignore assets from other version files than Minecraft + // workaround for stupid assets issue caused by amazon: + // https://www.theregister.co.uk/2017/02/28/aws_is_awol_as_s3_goes_haywire/ + profile->applyMinecraftAssets(mojangAssetIndex); } - profile->applyMinecraftVersion(minecraftVersion); + profile->applyMainClass(mainClass); profile->applyAppletClass(appletClass); profile->applyMinecraftArguments(minecraftArguments); - if (isMinecraftVersion()) - { - profile->applyMinecraftVersionType(type); - } - profile->applyMinecraftAssets(mojangAssetIndex); profile->applyTweakers(addTweakers); - profile->applyJarMods(jarMods); profile->applyTraits(traits); @@ -58,3 +49,14 @@ void VersionFile::applyTo(MinecraftProfile *profile) iter++; } } + +/* + auto theirVersion = profile->getMinecraftVersion(); + if (!theirVersion.isNull() && !dependsOnMinecraftVersion.isNull()) + { + if (QRegExp(dependsOnMinecraftVersion, Qt::CaseInsensitive, QRegExp::Wildcard).indexIn(theirVersion) == -1) + { + throw MinecraftVersionMismatch(uid, dependsOnMinecraftVersion, theirVersion); + } + } +*/
\ No newline at end of file |