From 749a41b79775212a4ccb358e8407dc246d357e7a Mon Sep 17 00:00:00 2001 From: 1532658585 Date: Tue, 9 Dec 2025 19:32:50 -0500 Subject: [PATCH] Update TheAlteningAccount.java --- .../accounts/types/TheAlteningAccount.java | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java index 663f63ff15..ca55d16acd 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java @@ -54,19 +54,38 @@ public boolean fetchInfo() { } } - @Override - public boolean login() { - if (auth == null) return false; - applyLoginEnvironment(SERVICE); - - try { - setSession(new Session(auth.getCurrentProfile().name(), auth.getCurrentProfile().id(), auth.getAccessToken(), Optional.empty(), Optional.empty())); - return true; - } catch (Exception e) { - MeteorClient.LOG.error("Failed to login with TheAltening."); - return false; +@Override +public boolean login() { + try { + // Make sure we have an auth instance + if (auth == null) auth = getAuth(); + if (!auth.isLoggedIn()) { + auth.logIn(); } + + // Use the default Mojang environment (from Account.login) + // instead of rewiring everything to TheAltening + super.login(); + + // Install the TheAltening session into the client + setSession(new Session( + auth.getCurrentProfile().name(), + auth.getCurrentProfile().id(), + auth.getAccessToken(), + Optional.empty(), + Optional.empty() + )); + + return true; + } catch (InvalidCredentialsException e) { + MeteorClient.LOG.error("Invalid TheAltening credentials.", e); + return false; + } catch (Exception e) { + MeteorClient.LOG.error("Failed to login with TheAltening.", e); + return false; } +} + private WaybackAuthLib getAuth() { WaybackAuthLib auth = new WaybackAuthLib(ENVIRONMENT.servicesHost());