aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt23
3 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 9151cc7a8..75fe70e48 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -20,6 +20,7 @@ import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatFilter
import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatModifier
import at.hannibal2.skyhanni.features.commands.PartyTransferCommand
import at.hannibal2.skyhanni.features.commands.SendCoordinatedCommand
+import at.hannibal2.skyhanni.features.commands.WarpIsCommand
import at.hannibal2.skyhanni.features.commands.WikiCommand
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.features.dungeon.*
@@ -212,6 +213,7 @@ class SkyHanniMod {
loadModule(RngMeterInventory())
loadModule(WikiCommand())
loadModule(SendCoordinatedCommand())
+ loadModule(WarpIsCommand())
loadModule(PartyTransferCommand())
loadModule(SummoningMobManager())
loadModule(AreaMiniBossFeatures())
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java
index 14b915b4b..c5be4a03b 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java
@@ -16,4 +16,9 @@ public class CommandsFeatures {
"§7SkyBlock command §e/pt §7to check the play time still works.")
@ConfigEditorBoolean
public boolean usePartyTransferAlias = true;
+
+ @Expose
+ @ConfigOption(name = "Replace Warp Is", desc = "Replaces §e/warp is §7with §e/is§7. Idk why. Ask §cKaeso")
+ @ConfigEditorBoolean
+ public boolean replaceWarpIs = false;
}
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