From 0f48e0fc06fa89aabea639da8a91fc539c70e138 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 8 Dec 2022 18:42:51 -0700 Subject: [PATCH] fix(blockedmods): Track and use targetFolder for blocked files Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/modplatform/flame/FlameInstanceCreationTask.cpp | 3 ++- launcher/modplatform/modpacksch/FTBPackInstallTask.cpp | 3 ++- launcher/ui/dialogs/BlockedModsDialog.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp index f9258f24..ef635243 100644 --- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp +++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp @@ -419,6 +419,7 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop) blocked_mod.hash = result.hash; blocked_mod.matched = false; blocked_mod.localPath = ""; + blocked_mod.targetFolder = result.targetFolder; blocked_mods.append(blocked_mod); @@ -464,7 +465,7 @@ void FlameCreationTask::copyBlockedMods(QList const& blocked_mods) continue; } - auto dest_path = FS::PathCombine(m_stagingPath, "minecraft", "mods", mod.name); + auto dest_path = FS::PathCombine(m_stagingPath, "minecraft", mod.targetFolder, mod.name); setStatus(tr("Copying Blocked Mods (%1 out of %2 are done)").arg(QString::number(i), QString::number(total))); diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index 48caa938..2979663d 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -195,6 +195,7 @@ void PackInstallTask::onResolveModsSucceeded() blocked_mod.hash = results_file.hash; blocked_mod.matched = false; blocked_mod.localPath = ""; + blocked_mod.targetFolder = results_file.targetFolder; m_blocked_mods.append(blocked_mod); @@ -366,7 +367,7 @@ void PackInstallTask::copyBlockedMods() continue; } - auto dest_path = FS::PathCombine(m_stagingPath, ".minecraft", "mods", mod.name); + auto dest_path = FS::PathCombine(m_stagingPath, ".minecraft", mod.targetFolder, mod.name); setStatus(tr("Copying Blocked Mods (%1 out of %2 are done)").arg(QString::number(i), QString::number(total))); diff --git a/launcher/ui/dialogs/BlockedModsDialog.h b/launcher/ui/dialogs/BlockedModsDialog.h index f63d04b4..014f488a 100644 --- a/launcher/ui/dialogs/BlockedModsDialog.h +++ b/launcher/ui/dialogs/BlockedModsDialog.h @@ -41,6 +41,7 @@ struct BlockedMod { QString hash; bool matched; QString localPath; + QString targetFolder; }; QT_BEGIN_NAMESPACE