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 | |
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')
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 |