diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-11-21 19:16:08 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-11-21 19:16:08 -0500 |
commit | 43c6b9c0387eb0294d12f9de22baad7f9235b86f (patch) | |
tree | 8af2acaf7ed14d518984b83a56f8a617e2c4abdd /src/main/java/me/Danker/commands/LobbySkillsCommand.java | |
parent | b8481811e5e25f2a710053444347295010a6155c (diff) | |
download | SkyblockMod-43c6b9c0387eb0294d12f9de22baad7f9235b86f.tar.gz SkyblockMod-43c6b9c0387eb0294d12f9de22baad7f9235b86f.tar.bz2 SkyblockMod-43c6b9c0387eb0294d12f9de22baad7f9235b86f.zip |
Access static methods in static ways and remove unused imports
Diffstat (limited to 'src/main/java/me/Danker/commands/LobbySkillsCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/LobbySkillsCommand.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/me/Danker/commands/LobbySkillsCommand.java b/src/main/java/me/Danker/commands/LobbySkillsCommand.java index 696a855..679898d 100644 --- a/src/main/java/me/Danker/commands/LobbySkillsCommand.java +++ b/src/main/java/me/Danker/commands/LobbySkillsCommand.java @@ -46,13 +46,10 @@ public class LobbySkillsCommand extends CommandBase { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { EntityPlayer playerSP = (EntityPlayer) arg0; - ConfigHandler cf = new ConfigHandler(); - APIHandler ah = new APIHandler(); - boolean someErrored = false; Map<String, Double> unsortedSAList = new HashMap<String, Double>(); ArrayList<Double> lobbySkills = new ArrayList<Double>(); // Check key - String key = cf.getString("api", "APIKey"); + String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { playerSP.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "API key not set. Use /setkey.")); return; @@ -72,7 +69,7 @@ public class LobbySkillsCommand extends CommandBase { long biggestLastSave = 0; int profileIndex = -1; Thread.sleep(600); - JsonObject profileResponse = ah.getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key); + JsonObject profileResponse = APIHandler.getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); System.out.println("User " + player.getGameProfile().getName() + " failed with reason: " + reason); @@ -138,7 +135,7 @@ public class LobbySkillsCommand extends CommandBase { } else { Thread.sleep(600); // Sleep for another request System.out.println("Fetching skills from achievement API"); - JsonObject playerObject = ah.getResponse("https://api.hypixel.net/player?uuid=" + UUID + "&key=" + key); + JsonObject playerObject = APIHandler.getResponse("https://api.hypixel.net/player?uuid=" + UUID + "&key=" + key); if (!playerObject.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); |