aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-01 01:17:02 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-01 01:17:02 +0200
commitb57755be9d163a614aa9c6ea4666423732fba153 (patch)
treeed1d70aeef7c31dec595d1ef56bc621bdc0e9d90 /src/main/java/at/hannibal2/skyhanni/features
parent4a74d19f58fad20c3243f95d254e9f6d41994950 (diff)
downloadskyhanni-b57755be9d163a614aa9c6ea4666423732fba153.tar.gz
skyhanni-b57755be9d163a614aa9c6ea4666423732fba153.tar.bz2
skyhanni-b57755be9d163a614aa9c6ea4666423732fba153.zip
Added Replace Warp Is
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt23
1 files changed, 23 insertions, 0 deletions
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