From c52c6e4624606d753c3f987f8afc4de39fc87f41 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Thu, 7 Dec 2023 17:05:04 +0600 Subject: [PATCH] fixes --- src/main/java/net/silentclient/client/Client.java | 2 +- src/main/java/net/silentclient/client/utils/Players.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/silentclient/client/Client.java b/src/main/java/net/silentclient/client/Client.java index 7ed5384..dbc247d 100644 --- a/src/main/java/net/silentclient/client/Client.java +++ b/src/main/java/net/silentclient/client/Client.java @@ -439,7 +439,7 @@ public class Client { public PlayerResponse updateAccount() { try { - String content = Requests.post("https://api.silentclient.net/account/update", new JSONObject().append("server", Minecraft.getMinecraft().getCurrentServerData() != null ? Minecraft.getMinecraft().getCurrentServerData().serverIP : null).toString()); + String content = Requests.post("https://api.silentclient.net/account/update", new JSONObject().put("server", Minecraft.getMinecraft().getCurrentServerData() != null ? Minecraft.getMinecraft().getCurrentServerData().serverIP : null).toString()); GsonBuilder builder = new GsonBuilder(); Gson gson = builder.create(); diff --git a/src/main/java/net/silentclient/client/utils/Players.java b/src/main/java/net/silentclient/client/utils/Players.java index 837c726..2dfb54e 100644 --- a/src/main/java/net/silentclient/client/utils/Players.java +++ b/src/main/java/net/silentclient/client/utils/Players.java @@ -91,6 +91,9 @@ public class Players { return result.isOnline() ? "true" : "false"; } else { + if(isLoading) { + return "false"; + } Players.isLoading = true; Client.logger.info("Loading Account of " + name.toLowerCase()); playersCache.put(name.toLowerCase(), null); @@ -132,7 +135,7 @@ public class Players { public static void register() { try { - String content = Requests.post("https://api.silentclient.net/account/set_online", new JSONObject().append("online", true).toString()); + String content = Requests.post("https://api.silentclient.net/account/set_online", new JSONObject().put("online", true).toString()); Client.logger.info("STARTING > registering-player > response: " + content); } catch (Exception e) { @@ -143,7 +146,7 @@ public class Players { public static void unregister() { try { - String content = Requests.post("https://api.silentclient.net/account/set_online", new JSONObject().append("online", true).toString()); + String content = Requests.post("https://api.silentclient.net/account/set_online", new JSONObject().put("online", true).toString()); Client.logger.info("STOPPING > unregistering-player > response: " + content.toString()); } catch (Exception e) {