aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands/BankCommand.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-09-05 18:35:43 -0400
committerGitHub <noreply@github.com>2020-09-05 18:35:43 -0400
commit20b405f59dcd92df1b4c3cd5b9ac353652ef4405 (patch)
treef387a1ca10387c77381a22568b486984da5b38a6 /src/main/java/me/Danker/commands/BankCommand.java
parent3ed5e14d43c6f3ff3cdce7598d01254e9465c33d (diff)
parenta29cfb42db5da544f8445f56acb3742e396d8dee (diff)
downloadSkyblockMod-20b405f59dcd92df1b4c3cd5b9ac353652ef4405.tar.gz
SkyblockMod-20b405f59dcd92df1b4c3cd5b9ac353652ef4405.tar.bz2
SkyblockMod-20b405f59dcd92df1b4c3cd5b9ac353652ef4405.zip
v1.7v1.7
Merge pull request #13 from bowser0000/development
Diffstat (limited to 'src/main/java/me/Danker/commands/BankCommand.java')
-rw-r--r--src/main/java/me/Danker/commands/BankCommand.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java
index e32e66f..952929f 100644
--- a/src/main/java/me/Danker/commands/BankCommand.java
+++ b/src/main/java/me/Danker/commands/BankCommand.java
@@ -3,6 +3,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;
@@ -25,8 +26,7 @@ public class BankCommand extends CommandBase {
}
@Override
- public List<String> getCommandAliases()
- {
+ public List<String> getCommandAliases() {
return Collections.singletonList("purse");
}
@@ -91,6 +91,7 @@ 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;
+ NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US);
// Check for bank api
if (profileResponse.get("profile").getAsJsonObject().has("banking")) {
@@ -99,14 +100,14 @@ public class BankCommand extends CommandBase {
player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" +
EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" +
- EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.GOLD + NumberFormat.getInstance().format(bankCoins) + "\n" +
- EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + NumberFormat.getInstance().format(purseCoins) + "\n" +
+ EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.GOLD + nf.format(bankCoins) + "\n" +
+ EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" +
EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------"));
} else {
player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" +
EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" +
EnumChatFormatting.GREEN + " Bank: " + EnumChatFormatting.RED + "Bank API disabled.\n" +
- EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + NumberFormat.getInstance().format(purseCoins) + "\n" +
+ EnumChatFormatting.GREEN + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" +
EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------"));
}
}).start();