fix: query for Fabric mods if Quilt is in use

Right now we want to include Fabric mods in our searches where possible.
Modrinth allows definining multiple loaders, while Flame only allows a
single value.

As a compromise we ask for Fabric mods only on Flame and for both Fabric
and Quilt mods on Modrinth.
This commit is contained in:
Sefa Eyeoglu
2022-04-15 12:38:27 +02:00
parent a42d2afcee
commit cab9afa45f
3 changed files with 17 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#include "Json.h"
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
#include "modplatform/flame/FlameAPI.h"
#include "net/NetJob.h"
void FlameMod::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
@ -43,8 +44,9 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
BaseInstance* inst)
{
QVector<ModPlatform::IndexedVersion> unsortedVersions;
bool hasFabric = !(dynamic_cast<MinecraftInstance*>(inst))->getPackProfile()->getComponentVersion("net.fabricmc.fabric-loader").isEmpty();
QString mcVersion = (dynamic_cast<MinecraftInstance*>(inst))->getPackProfile()->getComponentVersion("net.minecraft");
auto profile = (dynamic_cast<MinecraftInstance*>(inst))->getPackProfile();
bool hasFabric = FlameAPI::getMappedModLoader(profile->getModLoader()) == ModAPI::Fabric;
QString mcVersion = profile->getComponentVersion("net.minecraft");
for (auto versionIter : arr) {
auto obj = versionIter.toObject();