diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-01 20:18:15 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-01 20:18:15 +0200 |
commit | 7149f4ef911349637c3a06362588cf2398c34ed7 (patch) | |
tree | e9b560e0769948692b71378ec2fb7d83e464588b /src/main/java/at/hannibal2 | |
parent | 70e1bcea4718a325fc23b8e926e4ec998482b396 (diff) | |
download | skyhanni-7149f4ef911349637c3a06362588cf2398c34ed7.tar.gz skyhanni-7149f4ef911349637c3a06362588cf2398c34ed7.tar.bz2 skyhanni-7149f4ef911349637c3a06362588cf2398c34ed7.zip |
Fixed private message with one word gets blue colored because of player rank hider
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt index 15eff6a85..a8b4d808c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt @@ -13,8 +13,8 @@ class PlayerChatModifier { private val patterns = mutableListOf<Regex>() init { - patterns.add("§(?:a|b|6)\\[(?:VIP|MVP)(?:(?:§.|\\+)*)](?: {1,2})(?:§[7ab6])?(\\w{2,16})".toRegex()) // ranked player everywhere - patterns.add("§(?:7|a|b|6)((?:\\w){2,16})§r(?!§7x)".toRegex()) // nons in notification message + patterns.add("§[ab6]\\[(?:VIP|MVP)(?:(?:§.|\\+)*)](?: {1,2})(?:§[7ab6])?(\\w{2,16})".toRegex()) // ranked player with prefix everywhere + patterns.add("§[7ab6]((?:\\w){2,16})§r(?!§7x)(?!\$)".toRegex()) // all players without rank prefix in notification messages patterns.add("(?:§7 )?§7((?:\\w){2,16})§7§r".toRegex()) // nons user chat } @@ -36,7 +36,6 @@ class PlayerChatModifier { val newText = cutMessage(original) if (original == newText) return - val text = ChatComponentText(newText) if (size == 1) { val chatStyle = foundCommands[0].chatStyle @@ -73,8 +72,8 @@ class PlayerChatModifier { for (pattern in patterns) { string = string.replace(pattern, "§b$1") } - string = string.replace("§(?:7|a|b|6)((?:\\w+){2,16})'s", "§b$1's") - string = string.replace("§(?:7|a|b|6)((?:\\w+){2,16}) (§.)", "§b$1 $2") + string = string.replace("§[7ab6]((?:\\w+){2,16})'s", "§b$1's") + string = string.replace("§[7ab6]((?:\\w+){2,16}) (§.)", "§b$1 $2") // TODO remove workaround if (!DungeonMilestonesDisplay.isMilestoneMessage(input)) { |