From d0cbc11018c8126575117aaeb2b861957386fa9a Mon Sep 17 00:00:00 2001 From: Appability Date: Thu, 13 Oct 2022 18:58:00 -0700 Subject: steal a bunch of code from sbc! +melodyhelper, kuudra ready, wither shield overlay --- .../com/ambientaddons/features/keybinds/SendLastMessageKeybind.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/com/ambientaddons/features/keybinds') 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 } -- cgit