From 7078bca6311d190f1dfc7ee079ee470595d86f86 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sat, 21 Oct 2023 14:40:59 +0600 Subject: [PATCH 1/2] 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()); From 3af556bc269731dc6df3bbd842a4294bbcc039f6 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sun, 22 Oct 2023 13:46:23 +0600 Subject: [PATCH 2/2] Fix --- .../net/silentclient/client/mods/settings/GeneralMod.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java index 3c3a495..0398009 100644 --- a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java +++ b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java @@ -59,7 +59,9 @@ public class GeneralMod extends Mod { break; case "Menu Animations": case "Menu Animations Speed": - ClickGUI.introAnimation.setDuration(Client.getInstance().getSettingsManager().getSettingByName(this, "Menu Animations").getValBoolean() ? Client.getInstance().getSettingsManager().getSettingByName(this, "Menu Animations Speed").getValInt() : 1); + if(ClickGUI.introAnimation != null) { + ClickGUI.introAnimation.setDuration(Client.getInstance().getSettingsManager().getSettingByName(this, "Menu Animations").getValBoolean() ? Client.getInstance().getSettingsManager().getSettingByName(this, "Menu Animations Speed").getValInt() : 1); + } break; } }