diff options
author | nea <nea@nea.moe> | 2023-07-21 14:19:09 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-07-21 14:19:09 +0200 |
commit | 52fe85f9901dedd2a2deb6410050545b2c73b597 (patch) | |
tree | 539453b3f0de2a512b07ce8ae52006fc1b553151 /src | |
parent | f404c08a48f6d731491be3c3e09116c13e53ebb4 (diff) | |
download | SkyblockPlayersAnonymous-52fe85f9901dedd2a2deb6410050545b2c73b597.tar.gz SkyblockPlayersAnonymous-52fe85f9901dedd2a2deb6410050545b2c73b597.tar.bz2 SkyblockPlayersAnonymous-52fe85f9901dedd2a2deb6410050545b2c73b597.zip |
Kick if you do manage to join skyblock
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/github/romangraef/skyblockplayersanonymous/SPA.java | 11 |
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) { |