aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2023-01-13 21:15:10 -0300
committerflow <flowlnlnln@gmail.com>2023-01-13 21:15:10 -0300
commitebb0596c1a09a7c14f3c8e9e2cb311e652bd34e0 (patch)
tree46ce6463c6792bdf4da4dde082782a5ff4b327ca /launcher/minecraft/mod
parentb937d334362c0810ab59b3bc4660a2bbea31c7da (diff)
downloadPrismLauncher-ebb0596c1a09a7c14f3c8e9e2cb311e652bd34e0.tar.gz
PrismLauncher-ebb0596c1a09a7c14f3c8e9e2cb311e652bd34e0.tar.bz2
PrismLauncher-ebb0596c1a09a7c14f3c8e9e2cb311e652bd34e0.zip
fix: don't fail mod parsing when encountering invalid modListVersion
The spec (admitely a very old one) states that this entry should always have the value "2". However, some mods do not follow this convention, causing issues. One notable example is the 1.6 version of Aether II for 1.7.10, that has this value set at "5" for whatever reason. Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod')
-rw-r--r--launcher/minecraft/mod/tasks/LocalModParseTask.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalModParseTask.cpp b/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
index 8bfe2c84..91cb747f 100644
--- a/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
+++ b/launcher/minecraft/mod/tasks/LocalModParseTask.cpp
@@ -17,7 +17,7 @@
namespace ModUtils {
// NEW format
-// https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file/6f62b37cea040daf350dc253eae6326dd9c822c3
+// https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file/c8d8f1929aff9979e322af79a59ce81f3e02db6a
// OLD format:
// https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file/5bf6a2d05145ec79387acc0d45c958642fb049fc
@@ -74,10 +74,11 @@ ModDetails ReadMCModInfo(QByteArray contents)
version = Json::ensureString(val, "").toInt();
if (version != 2) {
- qCritical() << "BAD stuff happened to mod json:";
- qCritical() << contents;
- return {};
+ qWarning() << QString(R"(The value of 'modListVersion' is "%1" (expected "2")! The file may be corrupted.)").arg(version);
+ qWarning() << "The contents of 'mcmod.info' are as follows:";
+ qWarning() << contents;
}
+
auto arrVal = jsonDoc.object().value("modlist");
if (arrVal.isUndefined()) {
arrVal = jsonDoc.object().value("modList");