aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/utils/Utils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/utils/Utils.java')
-rw-r--r--src/main/java/me/Danker/utils/Utils.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index 1a24c69..160fc0a 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -145,17 +145,22 @@ public class Utils {
}
public static void checkForDungeons() {
- if (inSkyblock) {
- List<String> scoreboard = ScoreboardHandler.getSidebarLines();
- for (String s : scoreboard) {
- String sCleaned = ScoreboardHandler.cleanSB(s);
- if (sCleaned.contains("The Catacombs")) {
- inDungeons = true;
- return;
- }
+ if (inSkyblock) {
+ if (isInScoreboard("The Catacombs")) {
+ inDungeons = true;
+ return;
}
}
- inDungeons = false;
+ inDungeons = false;
+ }
+
+ public static boolean isInScoreboard(String text) {
+ List<String> scoreboard = ScoreboardHandler.getSidebarLines();
+ for (String s : scoreboard) {
+ String sCleaned = ScoreboardHandler.cleanSB(s);
+ if (sCleaned.contains(text)) return true;
+ }
+ return false;
}
public static String capitalizeString(String string) {