Made FriendHighLight case insensitive

This commit is contained in:
Bella 2020-05-15 14:34:13 -04:00
parent 88fe1a8333
commit 323a163bbe
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class FriendHighlight : Module() {
var listener = Listener(EventHook { event: ClientChatReceivedEvent ->
if (mc.player == null || noFriendsCheck()) return@EventHook
var converted = event.message.formattedText
Friends.friends.value.forEach(Consumer { friend: Friend -> converted = converted.replace(friend.username.toRegex(), colour() + bold() + friend.username + TextFormatting.RESET.toString()) })
Friends.friends.value.forEach(Consumer { friend: Friend -> converted = converted.replace(friend.username.toRegex(RegexOption.IGNORE_CASE), colour() + bold() + friend.username + TextFormatting.RESET.toString()) })
val message = TextComponentString(converted)
event.message = message
})