mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
Resolve issue with multiple loaders during update
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -58,7 +58,6 @@
|
||||
#include "ComponentUpdateTask.h"
|
||||
#include "PackProfile.h"
|
||||
#include "PackProfile_p.h"
|
||||
#include "minecraft/mod/Mod.h"
|
||||
#include "modplatform/ModIndex.h"
|
||||
|
||||
static const QMap<QString, ModPlatform::ModLoaderType> modloaderMapping{ { "net.neoforged", ModPlatform::NeoForge },
|
||||
@ -1022,3 +1021,23 @@ std::optional<ModPlatform::ModLoaderTypes> PackProfile::getSupportedModLoaders()
|
||||
loaders |= ModPlatform::Forge;
|
||||
return loaders;
|
||||
}
|
||||
|
||||
QList<ModPlatform::ModLoaderType> PackProfile::getModLoadersList()
|
||||
{
|
||||
QList<ModPlatform::ModLoaderType> result;
|
||||
for (auto c : d->components) {
|
||||
if (c->isEnabled() && modloaderMapping.contains(c->getID())) {
|
||||
result.append(modloaderMapping[c->getID()]);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove this or add version condition once Quilt drops official Fabric support
|
||||
if (result.contains(ModPlatform::Quilt) && !result.contains(ModPlatform::Fabric)) {
|
||||
result.append(ModPlatform::Fabric);
|
||||
}
|
||||
if (getComponentVersion("net.minecraft") == "1.20.1" && result.contains(ModPlatform::NeoForge) &&
|
||||
!result.contains(ModPlatform::Forge)) {
|
||||
result.append(ModPlatform::Forge);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user