diff options
author | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-30 08:24:42 +0200 |
---|---|---|
committer | CuzImClicks <bruno778.whiteelfie@gmail.com> | 2021-04-30 08:24:42 +0200 |
commit | a5572571f43ab3bd89c08678bba3050672be7615 (patch) | |
tree | 5169f378416544c0436186b5770d0d88fd26c981 /src/main/java/me/Danker/utils | |
parent | 09622e51e46d6772e9017bfa9bb544616ebba8b7 (diff) | |
parent | d79def85f593605e0ac2ff59232449b4a8446bb8 (diff) | |
download | SkyblockMod-a5572571f43ab3bd89c08678bba3050672be7615.tar.gz SkyblockMod-a5572571f43ab3bd89c08678bba3050672be7615.tar.bz2 SkyblockMod-a5572571f43ab3bd89c08678bba3050672be7615.zip |
Merge branch 'development' of https://github.com/bowser0000/SkyblockMod into development
Diffstat (limited to 'src/main/java/me/Danker/utils')
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 33 |
1 files changed, 24 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..d3d6325 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -30,6 +30,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Utils { @@ -45,6 +46,7 @@ public class Utils { 1065000, 1410000, 1900000, 2500000, 3300000, 4300000, 5600000, 7200000, 9200000, 12000000, 15000000, 19000000, 24000000, 30000000, 38000000, 48000000, 60000000, 75000000, 93000000, 116250000}; static int[] expertiseKills = {50, 100, 250, 500, 1000, 2500, 5500, 10000, 15000}; + static Pattern boldPattern = Pattern.compile("(?i)\\u00A7L"); public static int getItems(String item) { Minecraft mc = Minecraft.getMinecraft(); @@ -145,17 +147,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) { @@ -533,5 +540,13 @@ public class Utils { return null; } } + + public static boolean isRealPlayer(EntityPlayer player) { + return player.getUniqueID().version() == 4 && !player.isPlayerSleeping(); + } + + public static String removeBold(String text) { + return boldPattern.matcher(text).replaceAll(""); + } } |