diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-03-08 11:42:17 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 11:42:17 +1100 |
commit | 37f9c2fd312097ca539afacd6d04a24310dcd731 (patch) | |
tree | 618bd37a88068af3a7fecbca3bba9b7e892db0e1 /src/main/java/at | |
parent | c980f9c68fc0542f3a6c291648d831d96a31457c (diff) | |
download | skyhanni-37f9c2fd312097ca539afacd6d04a24310dcd731.tar.gz skyhanni-37f9c2fd312097ca539afacd6d04a24310dcd731.tar.bz2 skyhanni-37f9c2fd312097ca539afacd6d04a24310dcd731.zip |
fix chat symbols showing twice (#1119)
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt index 9492df47b..73cb02b5a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt @@ -31,7 +31,7 @@ class PlayerChatSymbols { ) private val symbolPattern by patternGroup.pattern( "symbol", - "((?:§\\w)+\\S)" + "(?:§.)+(\\S)" ) @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index a8ab6e6cd..f0456304e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -249,8 +249,9 @@ object StringUtils { modifyFirstChatComponent(chatComponent) { component -> if (component is ChatComponentText) { component as AccessorChatComponentText - if (component.text_skyhanni().contains(toReplace)) { - component.setText_skyhanni(component.text_skyhanni().replace(toReplace, replacement)) + val componentText = component.text_skyhanni() + if (componentText.contains(toReplace)) { + component.setText_skyhanni(componentText.replace(toReplace, replacement)) return@modifyFirstChatComponent true } return@modifyFirstChatComponent false |