From 7078bca6311d190f1dfc7ee079ee470595d86f86 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sat, 21 Oct 2023 14:40:59 +0600 Subject: [PATCH] Update AccountManager.java --- .../silentclient/client/utils/AccountManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/silentclient/client/utils/AccountManager.java b/src/main/java/net/silentclient/client/utils/AccountManager.java index cc51e1c..97d75a8 100644 --- a/src/main/java/net/silentclient/client/utils/AccountManager.java +++ b/src/main/java/net/silentclient/client/utils/AccountManager.java @@ -51,11 +51,13 @@ public class AccountManager { Requests.httpPost(Client.getInstance().getApiUrl() + "/set_selected", new JSONObject().put("selected", index).toString()); } selected = account; - Session session = new Session(account.username, nameToUuid(account.username), account.mc_access_token != null ? account.mc_access_token : "0", account.mc_access_token != null ? "msa" : "legacy"); - ((MinecraftExt) Minecraft.getMinecraft()).setSession(session); - Client.getInstance().getUserData().setAccessToken(selected.access_token); - Client.getInstance().getSilentSocket().Disconnect(); - Client.getInstance().getSilentSocket().Connect(selected.access_token); + if(!force) { + Session session = new Session(account.username, nameToUuid(account.username), account.mc_access_token != null ? account.mc_access_token : "0", account.mc_access_token != null ? "msa" : "legacy"); + ((MinecraftExt) Minecraft.getMinecraft()).setSession(session); + Client.getInstance().getUserData().setAccessToken(selected.access_token); + Client.getInstance().getSilentSocket().Disconnect(); + Client.getInstance().getSilentSocket().Connect(selected.access_token); + } PlayerResponse acc = Client.getInstance().updateAccount(); if(acc != null) { Client.getInstance().setAccount(acc.getAccount());