aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/features/keybinds
diff options
context:
space:
mode:
authorAppability <appable@icloud.com>2022-10-13 18:58:00 -0700
committerAppability <appable@icloud.com>2022-10-13 18:58:00 -0700
commitd0cbc11018c8126575117aaeb2b861957386fa9a (patch)
treec5419fb1f00b147604bded231c1388d6b391d27e /src/main/kotlin/com/ambientaddons/features/keybinds
parentc599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8 (diff)
downloadAmbientAddons-d0cbc11018c8126575117aaeb2b861957386fa9a.tar.gz
AmbientAddons-d0cbc11018c8126575117aaeb2b861957386fa9a.tar.bz2
AmbientAddons-d0cbc11018c8126575117aaeb2b861957386fa9a.zip
steal a bunch of code from sbc! +melodyhelper, kuudra ready, wither shield overlay
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features/keybinds')
-rw-r--r--src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt b/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt
index cbf4cd9..b7e5fad 100644
--- a/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt
+++ b/src/main/kotlin/com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt
@@ -14,7 +14,9 @@ object SendLastMessageKeybind {
fun onSendChat(event: MessageSentEvent) {
if (!SkyBlock.onHypixel) return
if (event.message.startsWith("/pc", ignoreCase = true)) {
- lastMessage = event.message.substring(4 until event.message.length)
+ lastMessage = event.message.runCatching {
+ substring(4 until event.message.length)
+ }.getOrNull()
} else if (!event.message.startsWith("/")) {
lastMessage = event.message
}