diff options
author | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2023-05-25 18:03:56 -0400 |
---|---|---|
committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2023-06-22 11:33:35 +0800 |
commit | 284518527393aa3363c15119c41d28f863122e37 (patch) | |
tree | 11b3656c7920dfa2a6ec3dfb32b9f4546db10f0d /src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java | |
parent | 3ecd4afc187a69c174fa4dfa1622e705700f674c (diff) | |
download | Skyblocker-284518527393aa3363c15119c41d28f863122e37.tar.gz Skyblocker-284518527393aa3363c15119c41d28f863122e37.tar.bz2 Skyblocker-284518527393aa3363c15119c41d28f863122e37.zip |
Abstract different checking methods in Utils
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java index 6f238b44..887476f2 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java +++ b/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java @@ -77,8 +77,14 @@ public class Utils { ClientReceiveMessageEvents.ALLOW_GAME.register(Utils::onChatMessage); } - public static void sbChecker() { + public static void update() { MinecraftClient client = MinecraftClient.getInstance(); + updateFromScoreboard(client); + updateFromPlayerList(client); + updateLocRaw(); + } + + public static void updateFromScoreboard(MinecraftClient client) { List<String> sidebar; if (client.world == null || client.isInSingleplayer() || (sidebar = getSidebar()) == null) { @@ -104,8 +110,6 @@ public class Utils { SkyblockEvents.LEAVE.invoker().onSkyblockLeave(); } isInDungeons = isOnSkyblock && string.contains("The Catacombs"); - updateFromPlayerList(client); - updateLocRaw(); } public static String getLocation() { |