diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-04 16:10:20 +0100 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-04 16:10:20 +0100 |
| commit | 357f7493e2cadbe8a543710e71e702874e16df29 (patch) | |
| tree | 7dd7c5f35eb24b0123a723b1739068b443a5f41c /src/main/java/at/hannibal2/skyhanni/features/chat | |
| parent | 5a8d02dcd10015f310bab9d18558d2299c856dd1 (diff) | |
| download | skyhanni-357f7493e2cadbe8a543710e71e702874e16df29.tar.gz skyhanni-357f7493e2cadbe8a543710e71e702874e16df29.tar.bz2 skyhanni-357f7493e2cadbe8a543710e71e702874e16df29.zip | |
cleanPlayerName respects playerRankHider option now.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt index 43ea37c16..9d071b956 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.groupOrNull +import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -48,7 +49,10 @@ class CompactSplashPotionMessage { it.matchMatcher(this) { val effectName = group("effectName") // If splashed by a player, append their name. - val byPlayer = groupOrNull("playerName")?.let { player -> " by $player" } ?: "" + val byPlayer = groupOrNull("playerName")?.let { player -> + val displayName = player.cleanPlayerName(displayName = true) + " §aby $displayName" + } ?: "" sendMessage("§a§lPotion Effect! §r$effectName$byPlayer") } != null } |
