diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-01 01:17:02 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-01 01:17:02 +0200 |
commit | b57755be9d163a614aa9c6ea4666423732fba153 (patch) | |
tree | ed1d70aeef7c31dec595d1ef56bc621bdc0e9d90 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 4a74d19f58fad20c3243f95d254e9f6d41994950 (diff) | |
download | skyhanni-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.kt | 23 |
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 |