From 503bedead4b991c17ef5406b4f7236bcc9cc9645 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Mon, 27 Feb 2023 02:05:20 +0900 Subject: - Fix racecondition isOnHypixel NPE Signed-off-by: syeyoung --- mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java | 5 +++-- 1 file 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; } -- cgit