aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft')
-rw-r--r--launcher/minecraft/mod/ResourcePack.cpp7
-rw-r--r--launcher/minecraft/mod/ResourcePackFolderModel.cpp11
2 files changed, 9 insertions, 9 deletions
diff --git a/launcher/minecraft/mod/ResourcePack.cpp b/launcher/minecraft/mod/ResourcePack.cpp
index cc8d23ce..3fc10a2f 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<Version, Version> 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 66b6cf5e..f8a6c1cf 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();