aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/commands/SkyblockPlayersCommand.java')
-rw-r--r--src/main/java/me/Danker/commands/SkyblockPlayersCommand.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java
index 24c3152..aca61ee 100644
--- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java
+++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java
@@ -44,19 +44,17 @@ public class SkyblockPlayersCommand extends CommandBase {
public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
// MULTI THREAD DRIFTING
new Thread(() -> {
- APIHandler ah = new APIHandler();
- ConfigHandler cf = new ConfigHandler();
EntityPlayer player = (EntityPlayer) arg0;
// Check key
- String key = cf.getString("api", "APIKey");
+ String key = ConfigHandler.getString("api", "APIKey");
if (key.equals("")) {
player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "API key not set. Use /setkey."));
}
String playersURL = "https://api.hypixel.net/gameCounts?key=" + key;
System.out.println("Fetching player count...");
- JsonObject playersResponse = ah.getResponse(playersURL);
+ JsonObject playersResponse = APIHandler.getResponse(playersURL);
if (!playersResponse.get("success").getAsBoolean()) {
String reason = playersResponse.get("cause").getAsString();
player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Failed with reason: " + reason));