Skip to content

Commit

Permalink
Merge pull request #156 from alexiayaa/improve-hypixel-detection
Browse files Browse the repository at this point in the history
Detect Hypixel even when connecting using a different address
  • Loading branch information
bowser0000 authored Dec 9, 2023
2 parents 9b8d8a2 + e1df09d commit d2f73ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/me/Danker/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ public static void createTitle(String text, int seconds) {
public static boolean isOnHypixel() {
Minecraft mc = Minecraft.getMinecraft();
if (mc != null && mc.theWorld != null && !mc.isSingleplayer()) {
return mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel");
if (mc.thePlayer != null && mc.thePlayer.getClientBrand() != null && mc.thePlayer.getClientBrand().toLowerCase().contains("hypixel")) {
return true;
}
if (mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) {
return true;
}
}
return false;
}
Expand Down

0 comments on commit d2f73ad

Please sign in to comment.