aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:27:11 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:27:11 -0400
commit804767ebfc26e2a1252bc327def02389b35dfc6e (patch)
treee3e06c24454080f059355133d633e5a076d85ad3 /src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
parent98ee5a2ae8090c061b1e61e7955d793416991822 (diff)
downloadSkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.tar.gz
SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.tar.bz2
SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.zip
fine
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
index 847b6c7..7da9c9d 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CurrencyHandler.java
@@ -34,16 +34,10 @@ public class CurrencyHandler {
@SubscribeEvent
public void onSidebarLineUpdate(SidebarLineUpdateEvent event) {
- if (
- Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("purse:") ||
- Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("piggy:")
- ) {
+ if (Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("purse:") || Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("piggy:")) {
CurrencyHandler.checkCoins(event.formattedLine);
}
- if (
- Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("bits:") &&
- !event.formattedLine.toLowerCase().contains("(")
- ) {
+ if (Utils.removeColor(event.formattedLine.toLowerCase().trim()).contains("bits:") && !event.formattedLine.toLowerCase().contains("(")) {
CurrencyHandler.checkBits(event.formattedLine);
}
}
@@ -69,12 +63,7 @@ public class CurrencyHandler {
}
public static void checkCoins(String formatedScoreboardLine) {
- String purse = Utils
- .removeWhiteSpaceAndRemoveWord(
- Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()),
- Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()).contains("purse:") ? "purse:" : "piggy:"
- )
- .replace(",", "");
+ String purse = Utils.removeWhiteSpaceAndRemoveWord(Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()), Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()).contains("purse:") ? "purse:" : "piggy:").replace(",", "");
if (!purse.contains("(") && !purse.contains("+")) {
try {
double coins = Double.parseDouble(Pattern.compile("[^0-9.]").matcher(purse).replaceAll(""));
@@ -86,9 +75,7 @@ public class CurrencyHandler {
}
public static void checkBits(String formatedScoreboardLine) {
- String bits = Utils
- .removeWhiteSpaceAndRemoveWord(Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()), "bits:")
- .replace(",", "");
+ String bits = Utils.removeWhiteSpaceAndRemoveWord(Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()), "bits:").replace(",", "");
try {
int bit = Integer.parseInt(Pattern.compile("[^0-9]").matcher(bits).replaceAll(""));
CurrencyHandler.setBits(bit);