fix: only consider enabled mod loaders
This commit is contained in:
parent
b2878dca1d
commit
77caaca50d
@ -36,6 +36,13 @@
|
|||||||
#include "ComponentUpdateTask.h"
|
#include "ComponentUpdateTask.h"
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
#include "modplatform/ModAPI.h"
|
||||||
|
|
||||||
|
static const QMap<QString, ModAPI::ModLoaderType> modloaderMapping{
|
||||||
|
{"net.minecraftforge", ModAPI::Forge},
|
||||||
|
{"net.fabricmc.fabric-loader", ModAPI::Fabric},
|
||||||
|
{"org.quiltmc.quilt-loader", ModAPI::Quilt}
|
||||||
|
};
|
||||||
|
|
||||||
PackProfile::PackProfile(MinecraftInstance * instance)
|
PackProfile::PackProfile(MinecraftInstance * instance)
|
||||||
: QAbstractListModel()
|
: QAbstractListModel()
|
||||||
@ -973,17 +980,15 @@ void PackProfile::disableInteraction(bool disable)
|
|||||||
|
|
||||||
ModAPI::ModLoaderType PackProfile::getModLoader()
|
ModAPI::ModLoaderType PackProfile::getModLoader()
|
||||||
{
|
{
|
||||||
if (!getComponentVersion("net.minecraftforge").isEmpty())
|
QMapIterator<QString, ModAPI::ModLoaderType> i(modloaderMapping);
|
||||||
|
|
||||||
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
return ModAPI::Forge;
|
i.next();
|
||||||
|
Component* c = getComponent(i.key());
|
||||||
|
if (c != nullptr && c->isEnabled()) {
|
||||||
|
return i.value();
|
||||||
}
|
}
|
||||||
else if (!getComponentVersion("net.fabricmc.fabric-loader").isEmpty())
|
|
||||||
{
|
|
||||||
return ModAPI::Fabric;
|
|
||||||
}
|
|
||||||
else if (!getComponentVersion("org.quiltmc.quilt-loader").isEmpty())
|
|
||||||
{
|
|
||||||
return ModAPI::Quilt;
|
|
||||||
}
|
}
|
||||||
return ModAPI::Unspecified;
|
return ModAPI::Unspecified;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user