aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands/FairySoulsCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/commands/FairySoulsCommand.java')
-rw-r--r--src/main/java/me/Danker/commands/FairySoulsCommand.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/me/Danker/commands/FairySoulsCommand.java b/src/main/java/me/Danker/commands/FairySoulsCommand.java
index b93d596..b0c67b2 100644
--- a/src/main/java/me/Danker/commands/FairySoulsCommand.java
+++ b/src/main/java/me/Danker/commands/FairySoulsCommand.java
@@ -52,6 +52,7 @@ public class FairySoulsCommand extends CommandBase {
String key = ConfigHandler.getString("api", "APIKey");
if(key.equals("")) {
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey."));
+ return;
}
// Get UUID for Hypixel API requests
@@ -74,7 +75,7 @@ public class FairySoulsCommand extends CommandBase {
String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key;
System.out.println("Fetching profile...");
- JsonObject profileResponse = APIHandler.getResponse(profileURL);
+ JsonObject profileResponse = APIHandler.getResponse(profileURL, true);
if (!profileResponse.get("success").getAsBoolean()) {
String reason = profileResponse.get("cause").getAsString();
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason));
@@ -88,7 +89,7 @@ public class FairySoulsCommand extends CommandBase {
int fairy_souls = userObject.get("fairy_souls_collected").getAsInt();
System.out.println(fairy_souls);
- player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "The player " + username + " has " + DankersSkyblockMod.VALUE_COLOUR + fairy_souls + DankersSkyblockMod.MAIN_COLOUR + "/222" + " collected"));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "The player " + username + " has " + DankersSkyblockMod.VALUE_COLOUR + fairy_souls + DankersSkyblockMod.MAIN_COLOUR + "/227" + " collected"));
}).start();