aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands/SlayerCommand.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-12-01 20:03:14 -0500
committerbowser0000 <bowser0000@gmail.com>2020-12-01 20:03:14 -0500
commitdb9ad0bcd3f31ee7ad29dcba99469872c5143dbe (patch)
tree851cfa8a7de9a96e756326c2997a1daa1e4f2aba /src/main/java/me/Danker/commands/SlayerCommand.java
parent425281727a291f36039b80acba12e3fd2304de1a (diff)
downloadSkyblockMod-db9ad0bcd3f31ee7ad29dcba99469872c5143dbe.tar.gz
SkyblockMod-db9ad0bcd3f31ee7ad29dcba99469872c5143dbe.tar.bz2
SkyblockMod-db9ad0bcd3f31ee7ad29dcba99469872c5143dbe.zip
Fix warnings Eclipse didn't tell me about
Also rename TheMod.java to DankersSkyblockMod.java
Diffstat (limited to 'src/main/java/me/Danker/commands/SlayerCommand.java')
-rw-r--r--src/main/java/me/Danker/commands/SlayerCommand.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java
index 07119bb..6c83934 100644
--- a/src/main/java/me/Danker/commands/SlayerCommand.java
+++ b/src/main/java/me/Danker/commands/SlayerCommand.java
@@ -1,12 +1,7 @@
package me.Danker.commands;
-import java.text.NumberFormat;
-import java.util.List;
-import java.util.Locale;
-
import com.google.gson.JsonObject;
-
-import me.Danker.TheMod;
+import me.Danker.DankersSkyblockMod;
import me.Danker.handlers.APIHandler;
import me.Danker.handlers.ConfigHandler;
import me.Danker.utils.Utils;
@@ -18,6 +13,10 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
+import java.text.NumberFormat;
+import java.util.List;
+import java.util.Locale;
+
public class SlayerCommand extends CommandBase {
@Override
@@ -52,7 +51,7 @@ public class SlayerCommand extends CommandBase {
// Check key
String key = ConfigHandler.getString("api", "APIKey");
if (key.equals("")) {
- player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "API key not set. Use /setkey."));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey."));
}
// Get UUID for Hypixel API requests
@@ -61,10 +60,10 @@ public class SlayerCommand extends CommandBase {
if (arg1.length == 0) {
username = player.getName();
uuid = player.getUniqueID().toString().replaceAll("[\\-]", "");
- player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking slayer of " + TheMod.SECONDARY_COLOUR + username));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking slayer of " + DankersSkyblockMod.SECONDARY_COLOUR + username));
} else {
username = arg1[0];
- player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking slayer of " + TheMod.SECONDARY_COLOUR + username));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking slayer of " + DankersSkyblockMod.SECONDARY_COLOUR + username));
uuid = APIHandler.getUUID(username);
}
@@ -77,7 +76,7 @@ public class SlayerCommand extends CommandBase {
JsonObject profileResponse = APIHandler.getResponse(profileURL);
if (!profileResponse.get("success").getAsBoolean()) {
String reason = profileResponse.get("cause").getAsString();
- player.addChatMessage(new ChatComponentText(TheMod.ERROR_COLOUR + "Failed with reason: " + reason));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason));
return;
}
@@ -100,12 +99,12 @@ public class SlayerCommand extends CommandBase {
}
NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US);
- player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
EnumChatFormatting.AQUA + " " + username + "'s Total XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP) + "\n" +
- TheMod.TYPE_COLOUR + " Zombie XP: " + TheMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" +
- TheMod.TYPE_COLOUR + " Spider XP: " + TheMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" +
- TheMod.TYPE_COLOUR + " Wolf XP: " + TheMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n" +
- TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
+ DankersSkyblockMod.TYPE_COLOUR + " Zombie XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" +
+ DankersSkyblockMod.TYPE_COLOUR + " Spider XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" +
+ DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n" +
+ DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
}).start();
}