aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/tasks/LocalResourceParse.cpp
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-08 13:38:00 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-08 13:38:00 -0700
commite70407289266a205147bfb1293763e64dacb0f3e (patch)
tree88ee2558f93452caa0db727436c07cf450c197dd /launcher/minecraft/mod/tasks/LocalResourceParse.cpp
parent67d473aab773e7f94c394ebdde05581dc8f805de (diff)
downloadPrismLauncher-e70407289266a205147bfb1293763e64dacb0f3e.tar.gz
PrismLauncher-e70407289266a205147bfb1293763e64dacb0f3e.tar.bz2
PrismLauncher-e70407289266a205147bfb1293763e64dacb0f3e.zip
fix(flame install): don't assume .zip is a resource pack. default to mod
let identifier move it if needed Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/mod/tasks/LocalResourceParse.cpp')
-rw-r--r--launcher/minecraft/mod/tasks/LocalResourceParse.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalResourceParse.cpp b/launcher/minecraft/mod/tasks/LocalResourceParse.cpp
index 4d760df2..6d9b4d97 100644
--- a/launcher/minecraft/mod/tasks/LocalResourceParse.cpp
+++ b/launcher/minecraft/mod/tasks/LocalResourceParse.cpp
@@ -44,7 +44,11 @@ static const QMap<PackedResourceType, QString> s_packed_type_names = {
namespace ResourceUtils {
PackedResourceType identify(QFileInfo file){
if (file.exists() && file.isFile()) {
- if (ResourcePackUtils::validate(file)) {
+ if (ModUtils::validate(file)) {
+ // mods can contain resource and data packs so they much be tested first
+ qDebug() << file.fileName() << "is a mod";
+ return PackedResourceType::Mod;
+ } else if (ResourcePackUtils::validate(file)) {
qDebug() << file.fileName() << "is a resource pack";
return PackedResourceType::ResourcePack;
} else if (TexturePackUtils::validate(file)) {
@@ -53,9 +57,6 @@ PackedResourceType identify(QFileInfo file){
} else if (DataPackUtils::validate(file)) {
qDebug() << file.fileName() << "is a data pack";
return PackedResourceType::DataPack;
- } else if (ModUtils::validate(file)) {
- qDebug() << file.fileName() << "is a mod";
- return PackedResourceType::Mod;
} else if (WorldSaveUtils::validate(file)) {
qDebug() << file.fileName() << "is a world save";
return PackedResourceType::WorldSave;