From 3629f2f90c24a76c3568cb63d4d03623ce1d54c7 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 28 Sep 2020 11:50:08 -0400 Subject: Fix player tab complete and UUID returning error 204 --- src/main/java/me/Danker/handlers/APIHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java index 34a73ff..b8d52dc 100644 --- a/src/main/java/me/Danker/handlers/APIHandler.java +++ b/src/main/java/me/Danker/handlers/APIHandler.java @@ -53,8 +53,11 @@ public class APIHandler { JsonObject object = gson.fromJson(error, JsonObject.class); return object; } + } else if (urlString.startsWith("https://api.mojang.com/users/profiles/minecraft/") && conn.getResponseCode() == 204) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: Player does not exist.")); + } else { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Request failed. HTTP Error Code: " + conn.getResponseCode())); } - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Request failed. HTTP Error Code: " + conn.getResponseCode())); } } catch (MalformedURLException ex) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "An error has occured. See logs for more details.")); -- cgit