package me.semx11.autotip.event;

import me.semx11.autotip.Autotip;
import me.semx11.autotip.misc.StartLogin;
import me.semx11.autotip.util.UniversalUtil;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientDisconnectionFromServerEvent;

public class HypixelListener {

    public static String lastIp;

    @SubscribeEvent
    public void playerLoggedIn(ClientConnectedToServerEvent event) {
        lastIp = UniversalUtil.getRemoteAddress(event).toString().toLowerCase();
        if (lastIp.contains(".hypixel.net") || lastIp.contains("209.222.115.14")) {
            Autotip.onHypixel = true;
            Tipper.waveCounter = 910;
            Autotip.THREAD_POOL.submit(new StartLogin());
        } else {
            Autotip.onHypixel = false;
        }
    }

    @SubscribeEvent
    public void playerLoggedOut(ClientDisconnectionFromServerEvent event) {
        Autotip.onHypixel = false;
    }

}
@@ -27,16 +27,48 @@
 event;%0A%0A
+import java.util.regex.Pattern;%0A
 import m
@@ -93,16 +93,16 @@
 utotip;%0A
-
 import m
@@ -467,16 +467,167 @@
 ener %7B%0A%0A
+    private static final Pattern IP_PATTERN = Pattern%0A            .compile(%22(%5E(%5B%5C%5Cw-%5D+%5B.%5C%5Cu2024%5D)?hypixel%5B.%5C%5Cu2024%5Dnet%7C209%5C%5C.222%5C%5C.115%5C%5C.%5C%5Cd%7B1,3%7D)%22);%0A%0A
     publ
@@ -838,75 +838,43 @@
 if (
-lastIp.contains(%22.hypixel.net%22) %7C%7C lastIp.contains(%22209.222.115.14%22
+IP_PATTERN.matcher(lastIp).matches(
 )) %7B

fix IP detection (thanks @tactful)