aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/romangraef/skyblockplayersanonymous/SPA.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/github/romangraef/skyblockplayersanonymous/SPA.java b/src/main/java/com/github/romangraef/skyblockplayersanonymous/SPA.java
index 0862c43..a90af25 100644
--- a/src/main/java/com/github/romangraef/skyblockplayersanonymous/SPA.java
+++ b/src/main/java/com/github/romangraef/skyblockplayersanonymous/SPA.java
@@ -6,6 +6,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.Vec3;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@@ -34,6 +35,16 @@ public class SPA {
}
@SubscribeEvent
+ public void onChat(ClientChatReceivedEvent event) {
+ if (event.message.getUnformattedText().replaceAll("§.", "").equals("Welcome to Hypixel SkyBlock!")) {
+ System.out.println("trying to kick you");
+ Minecraft.getMinecraft().addScheduledTask(() -> Minecraft.getMinecraft().getNetHandler().getNetworkManager().closeChannel(new ChatComponentText(
+ "§cYou joined SkyBlock. All hope is lost."
+ )));
+ }
+ }
+
+ @SubscribeEvent
public void onTick(TickEvent.ClientTickEvent tick) {
if (tick.phase == TickEvent.Phase.END && Minecraft.getMinecraft().thePlayer != null) {
if (new Vec3(-175, 125, 118).squareDistanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) < 100) {