Merge pull request #576 from Ryex/identify-zip-packs

fix https://github.com/PrismLauncher/PrismLauncher/issues/349
This commit is contained in:
Sefa Eyeoglu
2023-01-07 17:33:34 +01:00
committed by GitHub
48 changed files with 1858 additions and 162 deletions

View File

@ -43,6 +43,7 @@
#include "MetadataHandler.h"
#include "Version.h"
#include "minecraft/mod/ModDetails.h"
static ModPlatform::ProviderCapabilities ProviderCaps;
@ -70,6 +71,10 @@ void Mod::setMetadata(std::shared_ptr<Metadata::ModStruct>&& metadata)
m_local_details.metadata = metadata;
}
void Mod::setDetails(const ModDetails& details) {
m_local_details = details;
}
std::pair<int, bool> Mod::compare(const Resource& other, SortType type) const
{
auto cast_other = dynamic_cast<Mod const*>(&other);
@ -204,3 +209,8 @@ auto Mod::provider() const -> std::optional<QString>
return ProviderCaps.readableName(metadata()->provider);
return {};
}
bool Mod::valid() const
{
return !m_local_details.mod_id.isEmpty();
}