From 3b874526991d1d71c38bd391187e868f4898da0b Mon Sep 17 00:00:00 2001
From: HerozDotExe <66215011+HerozDotExe@users.noreply.github.com>
Date: Sun, 23 Feb 2025 10:50:49 +0100
Subject: [PATCH] feat: allow offline accounts
---
launcher/minecraft/auth/MinecraftAccount.h | 2 +-
launcher/ui/pages/global/AccountListPage.cpp | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/launcher/minecraft/auth/MinecraftAccount.h b/launcher/minecraft/auth/MinecraftAccount.h
index f6fcfada2..3f39e6e38 100644
--- a/launcher/minecraft/auth/MinecraftAccount.h
+++ b/launcher/minecraft/auth/MinecraftAccount.h
@@ -116,7 +116,7 @@ class MinecraftAccount : public QObject, public Usable {
[[nodiscard]] AccountType accountType() const noexcept { return data.type; }
- bool ownsMinecraft() const { return data.type != AccountType::Offline && data.minecraftEntitlement.ownsMinecraft; }
+ bool ownsMinecraft() const { return true; }
bool hasProfile() const { return data.profileId().size() != 0; }
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index 041b8faff..90eb6becf 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -141,14 +141,6 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
void AccountListPage::on_actionAddOffline_triggered()
{
- if (!m_accounts->anyAccountIsValid()) {
- QMessageBox::warning(this, tr("Error"),
- tr("You must add a Microsoft account that owns Minecraft before you can add an offline account."
- "
"
- "If you have lost your account you can contact Microsoft for support."));
- return;
- }
-
MinecraftAccountPtr account =
OfflineLoginDialog::newAccount(this, tr("Please enter your desired username to add your offline account."));