diff --git a/launcher/minecraft/mod/ResourcePack.cpp b/launcher/minecraft/mod/ResourcePack.cpp index cc8d23ce9..3fc10a2fd 100644 --- a/launcher/minecraft/mod/ResourcePack.cpp +++ b/launcher/minecraft/mod/ResourcePack.cpp @@ -23,8 +23,7 @@ void ResourcePack::setPackFormat(int new_format_id) QMutexLocker locker(&m_data_lock); if (!s_pack_format_versions.contains(new_format_id)) { - qCritical() << "Error: Pack format '%1' is not a recognized resource pack id."; - return; + qWarning() << "Pack format '%1' is not a recognized resource pack id!"; } m_pack_format = new_format_id; @@ -71,10 +70,6 @@ QPixmap ResourcePack::image(QSize size) std::pair ResourcePack::compatibleVersions() const { if (!s_pack_format_versions.contains(m_pack_format)) { - // Not having a valid pack format is fine if we didn't yet parse the .mcmeta file, - // but if we did and we still don't have a valid pack format, that's a bit concerning. - Q_ASSERT(!isResolved()); - return { {}, {} }; } diff --git a/launcher/minecraft/mod/ResourcePackFolderModel.cpp b/launcher/minecraft/mod/ResourcePackFolderModel.cpp index 66b6cf5e3..f8a6c1cfb 100644 --- a/launcher/minecraft/mod/ResourcePackFolderModel.cpp +++ b/launcher/minecraft/mod/ResourcePackFolderModel.cpp @@ -60,12 +60,17 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const case NameColumn: return m_resources[row]->name(); case PackFormatColumn: { - auto version_bounds = at(row)->compatibleVersions(); + auto resource = at(row); + auto pack_format = resource->packFormat(); + if (pack_format == 0) + return tr("Unrecognized"); + + auto version_bounds = resource->compatibleVersions(); if (version_bounds.first.toString().isEmpty()) - return QString::number(at(row)->packFormat()); + return QString::number(pack_format); return QString("%1 (%2 - %3)") - .arg(QString::number(at(row)->packFormat()), version_bounds.first.toString(), version_bounds.second.toString()); + .arg(QString::number(pack_format), version_bounds.first.toString(), version_bounds.second.toString()); } case DateColumn: return m_resources[row]->dateTimeChanged();