aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt31
1 files changed, 16 insertions, 15 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 b5927d31f..15eff6a85 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
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.chat.playerchat
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.features.dungeon.DungeonMilestonesDisplay
import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager
import net.minecraft.util.ChatComponentText
import net.minecraft.util.IChatComponent
@@ -13,8 +14,8 @@ class PlayerChatModifier {
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("(?:§7 )?§7((?:\\w+){2,16})§7§r".toRegex()) // nons user chat
+ patterns.add("§(?:7|a|b|6)((?:\\w){2,16})§r(?!§7x)".toRegex()) // nons in notification message
+ patterns.add("(?:§7 )?§7((?:\\w){2,16})§7§r".toRegex()) // nons user chat
}
@SubscribeEvent
@@ -68,19 +69,19 @@ class PlayerChatModifier {
}
}
-// if (SkyHanniMod.feature.chat.playerRankHider) {
-// 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")
-//
-// // TODO remove workaround
-// if (!DungeonMilestonesDisplay.isMilestoneMessage(input)) {
-// //all players same color in chat
-// string = string.replace("§r§7: ", "§r§f: ")
-// }
-// }
+ if (SkyHanniMod.feature.chat.playerRankHider) {
+ 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")
+
+ // TODO remove workaround
+ if (!DungeonMilestonesDisplay.isMilestoneMessage(input)) {
+ //all players same color in chat
+ string = string.replace("§r§7: ", "§r§f: ")
+ }
+ }
if (SkyHanniMod.feature.markedPlayers.highlightInChat) {
for (markedPlayer in MarkedPlayerManager.playerNamesToMark) {