From b57755be9d163a614aa9c6ea4666423732fba153 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 1 Aug 2023 01:17:02 +0200 Subject: Added Replace Warp Is --- .../skyhanni/features/commands/WarpIsCommand.kt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt new file mode 100644 index 000000000..d44459017 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt @@ -0,0 +1,23 @@ +package at.hannibal2.skyhanni.features.commands + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.PacketEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.network.play.client.C01PacketChatMessage +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class WarpIsCommand { + + @SubscribeEvent + fun onSendPacket(event: PacketEvent.SendEvent) { + if (!SkyHanniMod.feature.commands.replaceWarpIs) return + + val packet = event.packet + if (packet is C01PacketChatMessage) { + if (packet.message.lowercase() == "/warp is") { + event.isCanceled = true + LorenzUtils.sendMessageToServer("/is") + } + } + } +} \ No newline at end of file -- cgit