diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java index c7234935d..6f7607f9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsConfig.java @@ -69,7 +69,7 @@ public class CommandsConfig { public boolean useFandomWiki = false; @ConfigOption(name = "Party Commands", desc = "Shortens party commands and allows tab-completing for them. " + - "\n§eCommands: /pt /pp /pko /pk §7SkyBlock command §e/pt §7to check the play time still works.") + "\n§eCommands: /pt /pp /pko /pk §7SkyBlock command §e/pt §7to check the play time still works.") @Expose @ConfigEditorBoolean @FeatureToggle @@ -80,4 +80,10 @@ public class CommandsConfig { @ConfigEditorBoolean @FeatureToggle public boolean replaceWarpIs = false; + + @Expose + @ConfigOption(name = "/viewrecipe Lower Case", desc = "Adds support for lower case item IDs to the Hypixel command §e/viewrecipe§7.") + @ConfigEditorBoolean + @FeatureToggle + public boolean viewRecipeLowerCase = true; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt index f52ad10e3..0563f21ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt @@ -1,19 +1,22 @@ 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 ViewRecipeCommand { + private val config get() = SkyHanniMod.feature.commands @SubscribeEvent fun onSendPacket(event: PacketEvent.SendEvent) { + if (!config.viewRecipeLowerCase) return val packet = event.packet if (packet is C01PacketChatMessage) { - if (packet.message == packet.message.uppercase()) return - val message = packet.message.lowercase() - if (message.startsWith("/viewrecipe ")) { + val message = packet.message + if (message == message.uppercase()) return + if (message.startsWith("/viewrecipe ", ignoreCase = true)) { event.isCanceled = true LorenzUtils.sendMessageToServer(message.uppercase()) } |