aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands/BankCommand.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-12-07 19:00:24 -0500
committerGitHub <noreply@github.com>2020-12-07 19:00:24 -0500
commit0bd7c6336f5866ea5513f85a3cedf5c48e375ab2 (patch)
treec28066f2d9f819f57c42d8911f1e0046f48cdf60 /src/main/java/me/Danker/commands/BankCommand.java
parent886402bdcd8d68e6d1076c86d53baab47070dd63 (diff)
parentc5e8044e39f784798000b64bbece05eae0282d86 (diff)
downloadSkyblockMod-1.8.4.tar.gz
SkyblockMod-1.8.4.tar.bz2
SkyblockMod-1.8.4.zip
1.8.4v1.8.4
Merge pull request #42 from bowser0000/development
Diffstat (limited to 'src/main/java/me/Danker/commands/BankCommand.java')
-rw-r--r--src/main/java/me/Danker/commands/BankCommand.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java
index 6e2ddaa..e1bbdde 100644
--- a/src/main/java/me/Danker/commands/BankCommand.java
+++ b/src/main/java/me/Danker/commands/BankCommand.java
@@ -1,13 +1,7 @@
package me.Danker.commands;
-import java.text.NumberFormat;
-import java.util.Collections;
-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;
@@ -19,6 +13,11 @@ import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
+import java.text.NumberFormat;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
public class BankCommand extends CommandBase {
@Override
@@ -67,10 +66,10 @@ public class BankCommand extends CommandBase {
if (arg1.length == 0) {
username = player.getName();
uuid = player.getUniqueID().toString().replaceAll("[\\-]", "");
- player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking coins of " + TheMod.SECONDARY_COLOUR + username));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking coins of " + DankersSkyblockMod.SECONDARY_COLOUR + username));
} else {
username = arg1[0];
- player.addChatMessage(new ChatComponentText(TheMod.MAIN_COLOUR + "Checking coins of " + TheMod.SECONDARY_COLOUR + username));
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking coins of " + DankersSkyblockMod.SECONDARY_COLOUR + username));
uuid = APIHandler.getUUID(username);
}
@@ -89,25 +88,26 @@ public class BankCommand extends CommandBase {
System.out.println("Fetching bank + purse coins...");
double purseCoins = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("coin_purse").getAsDouble();
- purseCoins = (double) Math.floor(purseCoins * 100.0) / 100.0;
+ purseCoins = Math.floor(purseCoins * 100.0) / 100.0;
NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US);
// Check for bank api
if (profileResponse.get("profile").getAsJsonObject().has("banking")) {
double bankCoins = profileResponse.get("profile").getAsJsonObject().get("banking").getAsJsonObject().get("balance").getAsDouble();
- bankCoins = (double) Math.floor(bankCoins * 100.0) / 100.0;
+ bankCoins = Math.floor(bankCoins * 100.0) / 100.0;
- player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" +
- TheMod.TYPE_COLOUR + " Bank: " + EnumChatFormatting.GOLD + nf.format(bankCoins) + "\n" +
- TheMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" +
- TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
+ DankersSkyblockMod.TYPE_COLOUR + " Bank: " + EnumChatFormatting.GOLD + nf.format(bankCoins) + "\n" +
+ DankersSkyblockMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" +
+ DankersSkyblockMod.TYPE_COLOUR + " Total: " + EnumChatFormatting.GOLD + nf.format(bankCoins + purseCoins) + "\n" +
+ DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
} else {
- player.addChatMessage(new ChatComponentText(TheMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" +
EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" +
- TheMod.TYPE_COLOUR + " Bank: " + EnumChatFormatting.RED + "Bank API disabled.\n" +
- TheMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" +
- TheMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
+ DankersSkyblockMod.TYPE_COLOUR + " Bank: " + EnumChatFormatting.RED + "Bank API disabled.\n" +
+ DankersSkyblockMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" +
+ DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"));
}
}).start();
}