aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-15 21:45:46 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-15 21:45:46 +0200
commit0323a7a12effa810b6c360cdc4ce0e273e578802 (patch)
tree0c50df788d1e0b3b667efef2631fc3a04c87fb64 /src/main/java/at
parent38854e7b03ab06cb37096fff6b72a82472513581 (diff)
downloadskyhanni-0323a7a12effa810b6c360cdc4ce0e273e578802.tar.gz
skyhanni-0323a7a12effa810b6c360cdc4ce0e273e578802.tar.bz2
skyhanni-0323a7a12effa810b6c360cdc4ce0e273e578802.zip
removed empty line in player chat format
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt22
2 files changed, 27 insertions, 25 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt
index 975e29bf4..fcde746d9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt
@@ -44,8 +44,8 @@ class PlayerChatFilter {
val elitePosition = matcherElite.group(1).toInt()
rawMessage = matcherElite.group(2)
when (SkyHanniMod.feature.chat.eliteFormat) {
- 0 -> "§6[⌬$elitePosition]"
- 1 -> "§6§l⌬$elitePosition"
+ 0 -> "§6[⌬$elitePosition] "
+ 1 -> "§6§l⌬$elitePosition "
2 -> ""
else -> ""
}
@@ -139,38 +139,40 @@ class PlayerChatFilter {
loggerPlayerChat.log("message changed: $finalMessage")
}
- val prefix = if (channel == PlayerMessageChannel.ALL && !SkyHanniMod.feature.chat.allChannelPrefix)
- "" else getChannelPrefix(channel)
-
+ val channelPrefix = getChannelPrefix(channel)
val colon = if (SkyHanniMod.feature.chat.playerColonHider) "" else ":"
- LorenzUtils.chat("$prefix$elitePrefix $name§f$colon $finalMessage")
+ LorenzUtils.chat("$channelPrefix$elitePrefix$name§f$colon $finalMessage")
}
companion object {
fun getChannelPrefix(channel: PlayerMessageChannel): String {
+ if (channel == PlayerMessageChannel.ALL && !SkyHanniMod.feature.chat.allChannelPrefix) return ""
+
val color = channel.prefixColor
val small = channel.prefixSmall
val large = channel.prefixLarge
return when (SkyHanniMod.feature.chat.channelDesign) {
- 0 -> "$color$large §8>"
- 1 -> "$color$small>"
- 2 -> "§8<$color$small§8>"
- 3 -> "§8[$color$small§8]"
- 4 -> "§8($color$small§8)"
- else -> "$color$large §8>"
+ 0 -> "$color$large §8> "
+ 1 -> "$color$small> "
+ 2 -> "§8<$color$small§8> "
+ 3 -> "§8[$color$small§8] "
+ 4 -> "§8($color$small§8) "
+ else -> "$color$large §8> "
}
}
fun testAllChat() {
val name = Minecraft.getMinecraft().thePlayer.name
- val message = "§6[⌬499] §8[§b123§8] §6[MVP§c++§6] $name§f: This is a all chat test message and will not be sent to hypixel."
+ val message =
+ "§6[⌬499] §8[§b123§8] §6[MVP§c++§6] $name§f: This is a all chat test message and will not be sent to hypixel."
LorenzChatEvent(message, ChatComponentText(message)).postAndCatch()
}
fun testGuildChat() {
val name = Minecraft.getMinecraft().thePlayer.name
- val message = "§2Guild > §6[MVP§f++§6] $name §2[GuildRank]§f: This is a guild chat test message and will not be sent to hypixel."
+ val message =
+ "§2Guild > §6[MVP§f++§6] $name §2[GuildRank]§f: This is a guild chat test message and will not be sent to hypixel."
LorenzChatEvent(message, ChatComponentText(message)).postAndCatch()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt
index cbeaa9c45..8a0e3628b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt
@@ -20,20 +20,20 @@ class SkyBlockLevelChatMessage {
val message = event.message
val name = event.formattedName
- var prefix = if (event.channel == PlayerMessageChannel.ALL && !SkyHanniMod.feature.chat.allChannelPrefix)
- "" else PlayerChatFilter.getChannelPrefix(event.channel)
+ val channelPrefix = PlayerChatFilter.getChannelPrefix(event.channel)
- if (elitePrefix != "") {
- prefix = "$prefix $elitePrefix".trim()
- }
val colon = if (SkyHanniMod.feature.chat.playerColonHider) "" else ":"
- when (SkyHanniMod.feature.chat.skyblockLevelDesign) {
- 0 -> LorenzUtils.chat("$prefix §8[§$levelColor$level§8] $name§f$colon $message")
- 1 -> LorenzUtils.chat("$prefix §$levelColor§l$level $name§f$colon $message")
- 2 -> LorenzUtils.chat("$prefix $name §8[§$levelColor$level§8]§f$colon $message")
- 3 -> LorenzUtils.chat("$prefix $name§f$colon $message")
- }
+ val levelFormat = getLevelFormat(name)
+ LorenzUtils.chat("$channelPrefix$elitePrefix$levelFormat§f$colon $message")
level = -1
}
+
+ private fun getLevelFormat(name: String) = when (SkyHanniMod.feature.chat.skyblockLevelDesign) {
+ 0 -> "§8[§$levelColor${level}§8] $name"
+ 1 -> "§${levelColor}§l$level $name"
+ 2 -> "$name §8[§$levelColor${level}§8]"
+ 3 -> name
+ else -> "§8[§$levelColor${level}§8] $name"
+ }
} \ No newline at end of file