diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-26 17:57:05 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-26 17:57:05 +0100 |
commit | 2e772e88a46ad44c710e3d40ab9afcbbce6bd86a (patch) | |
tree | ee68fc7892af8182ca8c021f1869e7fef7f18bb9 /src/main | |
parent | 3392c42bf881c53feb661a998aa4f68bedb448cb (diff) | |
download | skyhanni-2e772e88a46ad44c710e3d40ab9afcbbce6bd86a.tar.gz skyhanni-2e772e88a46ad44c710e3d40ab9afcbbce6bd86a.tar.bz2 skyhanni-2e772e88a46ad44c710e3d40ab9afcbbce6bd86a.zip |
Fixed dungeon milestone messages getting wrongfully formatted.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt | 1 |
2 files changed, 6 insertions, 4 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 7967fddba..f10d8fd4c 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 @@ -60,9 +61,6 @@ class PlayerChatModifier { private fun cutMessage(input: String): String { var string = input - //all players same color in chat - string = string.replace("§r§7: ", "§r§f: ") - if (SkyHanniMod.feature.chat.chatFilter) { if (string.contains("§r§f: ")) { if (PlayerChatFilter.shouldChatFilter(string)) { @@ -77,6 +75,11 @@ class PlayerChatModifier { } 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") + + if (!DungeonMilestonesDisplay.isMilestoneMessage(input)) { + //all players same color in chat + string = string.replace("§r§7: ", "§r§f: ") + } } if (SkyHanniMod.feature.markedPlayers.highlightInChat) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt index fa62f39a2..b3581551d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -13,7 +13,6 @@ import kotlin.concurrent.fixedRateTimer class DungeonMilestonesDisplay { - companion object { private var display = "" var color = "" |