diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-27 02:05:20 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-27 02:05:20 +0900 |
commit | 503bedead4b991c17ef5406b4f7236bcc9cc9645 (patch) | |
tree | 1afaf7873deee8572153f09377146c57bbb204f8 /mod | |
parent | a68b4904060a4f27e5865588fdcae5e5c33fd0aa (diff) | |
download | Skyblock-Dungeons-Guide-503bedead4b991c17ef5406b4f7236bcc9cc9645.tar.gz Skyblock-Dungeons-Guide-503bedead4b991c17ef5406b4f7236bcc9cc9645.tar.bz2 Skyblock-Dungeons-Guide-503bedead4b991c17ef5406b4f7236bcc9cc9645.zip |
- Fix racecondition isOnHypixel NPE
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java index 453402a3..e071337d 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java @@ -97,8 +97,9 @@ public class SkyblockStatus { public static boolean isOnHypixel() { Minecraft mc = Minecraft.getMinecraft(); if (mc == null || mc.thePlayer == null) return false; - if (!mc.isSingleplayer() && mc.thePlayer.getClientBrand() != null) { - return mc.thePlayer.getClientBrand().startsWith("Hypixel BungeeCord"); + String clientBrand = mc.thePlayer.getClientBrand(); + if (!mc.isSingleplayer() && mc.loadingScreen != null) { + return clientBrand.startsWith("Hypixel BungeeCord"); } return false; } |