aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.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/ComponentHandler.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/ComponentHandler.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java48
1 files changed, 10 insertions, 38 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java
index ad7b1e8..d56fd30 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/ComponentHandler.java
@@ -38,19 +38,11 @@ public class ComponentHandler {
if (ticksExisted % 60 == 0) {
for (NetworkPlayerInfo player : players) {
if (player.getDisplayName() != null) {
- String formattedTabListPlayer = SCOREBOARD_CHARACTERS
- .matcher(Utils.removeColor(player.getDisplayName().getFormattedText()))
- .replaceAll("");
+ String formattedTabListPlayer = SCOREBOARD_CHARACTERS.matcher(Utils.removeColor(player.getDisplayName().getFormattedText())).replaceAll("");
if (LocationHandler.getCurrentLocation().equals(Locations.CATACOMBS)) {
- if (formattedTabListPlayer.toLowerCase().contains("secrets found:")) DungeonHandler.parseTotalSecrets(
- formattedTabListPlayer
- );
- if (formattedTabListPlayer.toLowerCase().contains("deaths:")) DungeonHandler.parseDeaths(
- formattedTabListPlayer
- );
- if (formattedTabListPlayer.toLowerCase().contains("crypts:")) DungeonHandler.parseCrypts(
- formattedTabListPlayer
- );
+ if (formattedTabListPlayer.toLowerCase().contains("secrets found:")) DungeonHandler.parseTotalSecrets(formattedTabListPlayer);
+ if (formattedTabListPlayer.toLowerCase().contains("deaths:")) DungeonHandler.parseDeaths(formattedTabListPlayer);
+ if (formattedTabListPlayer.toLowerCase().contains("crypts:")) DungeonHandler.parseCrypts(formattedTabListPlayer);
} else if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.DWARVENMINES)) {
if (formattedTabListPlayer.toLowerCase().contains("mithril powder:")) {
DwarvenMineHandler.parseMithril(formattedTabListPlayer);
@@ -58,8 +50,7 @@ public class ComponentHandler {
} else if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.MUSHROOMDESERT)) {
if (formattedTabListPlayer.toLowerCase().contains("pelts:")) {
try {
- FarmingIslandHandler.pelts =
- Integer.parseInt(formattedTabListPlayer.toLowerCase().replace("pelts:", "").trim());
+ FarmingIslandHandler.pelts = Integer.parseInt(formattedTabListPlayer.toLowerCase().replace("pelts:", "").trim());
} catch (Exception ignored) {}
}
}
@@ -68,15 +59,11 @@ public class ComponentHandler {
if (players.size() > 80) {
for (int i = 61; i <= 80; i++) {
if (players.get(i).getDisplayName() != null) {
- String formattedTabListPlayer = SCOREBOARD_CHARACTERS
- .matcher(Utils.removeColor(players.get(i).getDisplayName().getFormattedText()))
- .replaceAll("");
+ String formattedTabListPlayer = SCOREBOARD_CHARACTERS.matcher(Utils.removeColor(players.get(i).getDisplayName().getFormattedText())).replaceAll("");
if (formattedTabListPlayer.toLowerCase().contains("event:")) {
if (i < 80) {
if (players.get(i + 1).getDisplayName() != null) {
- String secondLine = SCOREBOARD_CHARACTERS
- .matcher(Utils.removeColor(players.get(i + 1).getDisplayName().getFormattedText()))
- .replaceAll("");
+ String secondLine = SCOREBOARD_CHARACTERS.matcher(Utils.removeColor(players.get(i + 1).getDisplayName().getFormattedText())).replaceAll("");
SeasonDateHandler.setCurrentEvent(formattedTabListPlayer.replace("Event:", ""), secondLine);
eventPass = true;
}
@@ -93,9 +80,7 @@ public class ComponentHandler {
if (players.size() >= 80) {
for (int i = 41; i <= 60; i++) {
if (players.get(i).getDisplayName() != null) {
- String formattedTabListPlayer = SCOREBOARD_CHARACTERS
- .matcher(Utils.removeColor(players.get(i).getDisplayName().getFormattedText()))
- .replaceAll("");
+ String formattedTabListPlayer = SCOREBOARD_CHARACTERS.matcher(Utils.removeColor(players.get(i).getDisplayName().getFormattedText())).replaceAll("");
if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.PARK)) {
if (formattedTabListPlayer.toLowerCase().contains("rain:")) {
ParkIslandHandler.parseRain(formattedTabListPlayer.toLowerCase());
@@ -114,9 +99,7 @@ public class ComponentHandler {
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onStatusBar(ClientChatReceivedEvent event) {
if (event.type == 2) {
- if (LocationHandler.getCurrentLocation().equals(Locations.CATACOMBS)) DungeonHandler.parseSecrets(
- event.message.getFormattedText()
- );
+ if (LocationHandler.getCurrentLocation().equals(Locations.CATACOMBS)) DungeonHandler.parseSecrets(event.message.getFormattedText());
}
}
@@ -128,18 +111,7 @@ public class ComponentHandler {
public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_) {
ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
- return ComparisonChain
- .start()
- .compareTrueFirst(
- p_compare_1_.getGameType() != WorldSettings.GameType.SPECTATOR,
- p_compare_2_.getGameType() != WorldSettings.GameType.SPECTATOR
- )
- .compare(
- scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "",
- scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : ""
- )
- .compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName())
- .result();
+ return ComparisonChain.start().compareTrueFirst(p_compare_1_.getGameType() != WorldSettings.GameType.SPECTATOR, p_compare_2_.getGameType() != WorldSettings.GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "").compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
}
}
}