diff options
Diffstat (limited to 'launcher/minecraft')
-rw-r--r-- | launcher/minecraft/PackProfile.cpp | 17 | ||||
-rw-r--r-- | launcher/minecraft/PackProfile.h | 3 | ||||
-rw-r--r-- | launcher/minecraft/mod/LocalModParseTask.cpp | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp index d516e555..9889727e 100644 --- a/launcher/minecraft/PackProfile.cpp +++ b/launcher/minecraft/PackProfile.cpp @@ -970,3 +970,20 @@ void PackProfile::disableInteraction(bool disable) } } } + +ModAPI::ModLoaderType PackProfile::getModLoader() +{ + if (!getComponentVersion("net.minecraftforge").isEmpty()) + { + return ModAPI::Forge; + } + else if (!getComponentVersion("net.fabricmc.fabric-loader").isEmpty()) + { + return ModAPI::Fabric; + } + else if (!getComponentVersion("org.quiltmc.quilt-loader").isEmpty()) + { + return ModAPI::Quilt; + } + return ModAPI::Any; +} diff --git a/launcher/minecraft/PackProfile.h b/launcher/minecraft/PackProfile.h index 989d1c6a..ab4cd5c8 100644 --- a/launcher/minecraft/PackProfile.h +++ b/launcher/minecraft/PackProfile.h @@ -28,6 +28,7 @@ #include "BaseVersion.h" #include "MojangDownloadInfo.h" #include "net/Mode.h" +#include "modplatform/ModAPI.h" class MinecraftInstance; struct PackProfileData; @@ -117,6 +118,8 @@ public: // todo(merged): is this the best approach void appendComponent(ComponentPtr component); + ModAPI::ModLoaderType getModLoader(); + private: void scheduleSave(); bool saveIsScheduled() const; diff --git a/launcher/minecraft/mod/LocalModParseTask.cpp b/launcher/minecraft/mod/LocalModParseTask.cpp index 757a2187..f01da8ae 100644 --- a/launcher/minecraft/mod/LocalModParseTask.cpp +++ b/launcher/minecraft/mod/LocalModParseTask.cpp @@ -391,7 +391,7 @@ void LocalModParseTask::processAsZip() zip.close(); return; } - else if (zip.setCurrentFile("fabric.mod.json")) + else if (zip.setCurrentFile("fabric.mod.json")) // TODO: Support quilt.mod.json { if (!file.open(QIODevice::ReadOnly)) { |