fix: check for Quilt as Fabric-compatible loader

This commit is contained in:
Sefa Eyeoglu
2022-02-20 20:55:26 +01:00
parent 74cdf5350d
commit 35cfb41a9c
11 changed files with 54 additions and 18 deletions

View File

@ -15,7 +15,7 @@ class ModAPI {
virtual ~ModAPI() = default;
// https://docs.curseforge.com/?http#tocS_ModLoaderType
enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4 };
enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4, Quilt = 5 };
struct SearchArgs {
int offset;

View File

@ -69,6 +69,7 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
for (auto m : modules) {
auto fname = Json::requireString(m.toObject(), "foldername");
// FIXME: This does not work properly when a mod supports more than one mod loader, since
// FIXME: This also doesn't deal with Quilt mods at the moment
// they bundle the meta files for all of them in the same arquive, even when that version
// doesn't support the given mod loader.
if (hasFabric) {

View File

@ -55,11 +55,13 @@ class ModrinthAPI : public NetworkModAPI {
{
switch (modLoader) {
case Any:
return "fabric, forge";
return "fabric, forge, quilt";
case Forge:
return "forge";
case Fabric:
return "fabric";
case Quilt:
return "quilt";
default:
return "";
}
@ -67,7 +69,7 @@ class ModrinthAPI : public NetworkModAPI {
inline auto validateModLoader(ModLoaderType modLoader) const -> bool
{
return modLoader == Any || modLoader == Forge || modLoader == Fabric;
return modLoader == Any || modLoader == Forge || modLoader == Fabric || modLoader == Quilt;
}
};