Fix Minecraft version not appearing in status bar

This commit is contained in:
Kenneth Chew 2022-06-29 00:34:13 -04:00
parent 286f82cc99
commit 06bf7b0f31
No known key found for this signature in database
GPG Key ID: F17D3E14A07739DA

View File

@ -826,8 +826,16 @@ QString MinecraftInstance::getStatusbarDescription()
traits.append(tr("broken"));
}
QString mcVersion = m_components->getComponentVersion("net.minecraft");
if (mcVersion.isEmpty())
{
// Load component info if needed
m_components->reload(Net::Mode::Offline);
mcVersion = m_components->getComponentVersion("net.minecraft");
}
QString description;
description.append(tr("Minecraft %1 (%2)").arg(m_components->getComponentVersion("net.minecraft")).arg(typeName()));
description.append(tr("Minecraft %1 (%2)").arg(mcVersion).arg(typeName()));
if(m_settings->get("ShowGameTime").toBool())
{
if (lastTimePlayed() > 0) {