diff options
author | RayDeeUx <raydeeux@gmail.com> | 2022-08-19 11:01:29 -0400 |
---|---|---|
committer | RayDeeUx <raydeeux@gmail.com> | 2022-08-19 11:01:29 -0400 |
commit | 62d9012e1b9b5a3337f5a9f0e01fd684c860a4ce (patch) | |
tree | 4270337e299f58487a1f0851303e5ed44bb50584 /src/main/java/com/thatgravyboat/skyblockhud/location | |
parent | d6751da4434b97237d278e1666c031084cd57934 (diff) | |
download | SkyblockHud-Death-Defied-62d9012e1b9b5a3337f5a9f0e01fd684c860a4ce.tar.gz SkyblockHud-Death-Defied-62d9012e1b9b5a3337f5a9f0e01fd684c860a4ce.tar.bz2 SkyblockHud-Death-Defied-62d9012e1b9b5a3337f5a9f0e01fd684c860a4ce.zip |
#BanishTheCommas
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/location')
3 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java index 005d9ff..884ff32 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java @@ -21,7 +21,7 @@ public class FarmHouseHandler { for (Medal value : Medal.values()) { if (event.formattedLine.contains(value.name())) { try { - medals[value.ordinal()] = Integer.parseInt(event.formattedLine.replace("medals:", "").replace(value.name(), "").trim()); + medals[value.ordinal()] = Integer.parseInt(event.formattedLine.replace("medals:", "").replace(value.name(), "").trim().replaceAll(",", "")); } catch (Exception ignored) {} break; } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java index cc6668a..223eaf0 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java @@ -31,22 +31,22 @@ public class IslandHandler { if (times.length == 2) { int s = 0; try { - s += Integer.parseInt(times[0]) * 60; + s += Integer.parseInt(times[0].replaceAll(",", "")) * 60; } catch (NumberFormatException ignored) {} try { - s += Integer.parseInt(times[1]); + s += Integer.parseInt(times[1].replaceAll(",", "")); } catch (NumberFormatException ignored) {} flightTime = s - 1; } else if (times.length == 3) { int s = 0; try { - s += Integer.parseInt(times[0]) * 3600; + s += Integer.parseInt(times[0].replaceAll(",", "")) * 3600; } catch (NumberFormatException ignored) {} try { - s += Integer.parseInt(times[1]) * 60; + s += Integer.parseInt(times[1].replaceAll(",", "")) * 60; } catch (NumberFormatException ignored) {} try { - s += Integer.parseInt(times[2]); + s += Integer.parseInt(times[2].replaceAll(",", "")); } catch (NumberFormatException ignored) {} flightTime = s - 1; } @@ -59,7 +59,7 @@ public class IslandHandler { if (LocationHandler.getCurrentLocation() == Locations.YOURISLAND) { if (formatedScoreboardLine.toLowerCase().contains("redstone:")) return true; try { - redstone = formatedScoreboardLine.toLowerCase().contains("redstone:") ? Integer.parseInt(Utils.removeWhiteSpaceAndRemoveWord(formatedScoreboardLine, "redstone:")) : 0; + redstone = formatedScoreboardLine.toLowerCase().contains("redstone:") ? Integer.parseInt(Utils.removeWhiteSpaceAndRemoveWord(formatedScoreboardLine, "redstone:").replaceAll(",", "")) : 0; } catch (Exception ignored) {} } return false; diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/MinesHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/MinesHandler.java index d49b681..865b2c1 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/location/MinesHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/MinesHandler.java @@ -73,13 +73,13 @@ public class MinesHandler { public static void parseMithril(String line) { try { - mithril = Integer.parseInt(line.toLowerCase().replace("mithril powder:", "").trim()); + mithril = Integer.parseInt(line.toLowerCase().replace("mithril powder:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } public static void parseGemstone(String line) { try { - gemstone = Integer.parseInt(line.toLowerCase().replace("gemstone powder:", "").trim()); + gemstone = Integer.parseInt(line.toLowerCase().replace("gemstone powder:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } @@ -87,17 +87,17 @@ public class MinesHandler { public void onSidebarLineUpdate(SidebarLineUpdateEvent event) { if (event.formattedLine.toLowerCase().contains("heat")) { try { - MiningHud.setHeat(Integer.parseInt(event.formattedLine.toLowerCase().replace("heat:", "").trim())); + MiningHud.setHeat(Integer.parseInt(event.formattedLine.toLowerCase().replace("heat:", "").trim().replaceAll(",", ""))); } catch (Exception ignored) {} } if (event.formattedLine.toLowerCase().contains("mithril")) { try { - mithril = Integer.parseInt(event.formattedLine.toLowerCase().replace("mithril:", "").trim()); + mithril = Integer.parseInt(event.formattedLine.toLowerCase().replace("mithril:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } if (event.formattedLine.toLowerCase().contains("gemstone")) { try { - gemstone = Integer.parseInt(event.formattedLine.toLowerCase().replace("gemstone:", "").trim()); + gemstone = Integer.parseInt(event.formattedLine.toLowerCase().replace("gemstone:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } if (event.formattedLine.toLowerCase().contains("event")) { @@ -115,7 +115,7 @@ public class MinesHandler { if (event.formattedLine.toLowerCase(Locale.ENGLISH).contains("nearby players")) { MinesHandler.currentEvent = Event.TOGETHER; try { - MinesHandler.eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("nearby players:", "").trim()); + MinesHandler.eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("nearby players:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } @@ -123,31 +123,31 @@ public class MinesHandler { if (MinesHandler.currentEvent == Event.TICKET) { if (event.formattedLine.toLowerCase().contains("pool:")) { try { - eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("pool:", "").trim().split("/")[0].trim()); + eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("pool:", "").trim().replaceAll(",", "").split("/")[0].trim().replaceAll(",", "")); } catch (Exception ignored) {} } else if (event.formattedLine.toLowerCase().contains("tickets:")) { try { - eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("tickets:", "").split("\\(")[0].trim()); + eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("tickets:", "").split("\\(")[0].trim().replaceAll(",", "")); } catch (Exception ignored) {} } } else if (MinesHandler.currentEvent == Event.GOBLIN) { if (event.formattedLine.toLowerCase().contains("remaining:")) { try { - eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("goblins", "").replace("remaining:", "").trim()); + eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("goblins", "").replace("remaining:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } else if (event.formattedLine.toLowerCase().contains("your kills:") && !event.formattedLine.toLowerCase().contains("(")) { try { - eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("your kills:", "").trim()); + eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("your kills:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } } else if (MinesHandler.currentEvent == Event.GOURMAND) { if (event.formattedLine.toLowerCase().contains("remaining:")) { try { - eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("tasty mithril", "").replace("remaining:", "").trim()); + eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("tasty mithril", "").replace("remaining:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } else if (event.formattedLine.toLowerCase().contains("your tasty mithril:") && !event.formattedLine.toLowerCase().contains("(")) { try { - eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("your tasty mithril:", "").trim()); + eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("your tasty mithril:", "").trim().replaceAll(",", "")); } catch (Exception ignored) {} } } |