diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-08-09 18:55:22 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-08-09 18:55:22 -0400 |
commit | a0866865a3c51adf96799f93f59a6d49b834efde (patch) | |
tree | ffa6f7f4b91f179c679844c2869905cdfb3ef311 /src/main/java/me/Danker/commands/BankCommand.java | |
parent | 166f6e05d2821d0fea1a14321a7a2b12e0f86bbb (diff) | |
download | SkyblockMod-a0866865a3c51adf96799f93f59a6d49b834efde.tar.gz SkyblockMod-a0866865a3c51adf96799f93f59a6d49b834efde.tar.bz2 SkyblockMod-a0866865a3c51adf96799f93f59a6d49b834efde.zip |
Fix number format of /bank and /slayer
Diffstat (limited to 'src/main/java/me/Danker/commands/BankCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/BankCommand.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java index e32e66f..683dae7 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; @@ -91,6 +92,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 +101,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(); |