aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-03-09 23:12:06 +1100
committerGitHub <noreply@github.com>2024-03-09 13:12:06 +0100
commitafbd5b2798be6c6ea611be521a9f7cd0e43497d1 (patch)
tree293b6caeaeb033084d72355ea4c540f6f513e066 /src/main/java
parent088377ba4b2ad6e763facea2ef6dea37d5a3690a (diff)
downloadskyhanni-afbd5b2798be6c6ea611be521a9f7cd0e43497d1.tar.gz
skyhanni-afbd5b2798be6c6ea611be521a9f7cd0e43497d1.tar.bz2
skyhanni-afbd5b2798be6c6ea611be521a9f7cd0e43497d1.zip
Fix: Double text in tablist (#1126)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabStringType.kt6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt
index 60d2ba77e..c6aa9a510 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt
@@ -173,7 +173,8 @@ object TabListRenderer {
middleX += 8 + 2
}
- val text = if (AdvancedPlayerList.ignoreCustomTabList()) tabLine.text else tabLine.customName
+ var text = if (AdvancedPlayerList.ignoreCustomTabList()) tabLine.text else tabLine.customName
+ if (text.contains("§l")) text = "§r$text"
if (tabLine.type == TabStringType.TITLE) {
minecraft.fontRendererObj.drawStringWithShadow(
text,
@@ -215,7 +216,7 @@ object TabListRenderer {
)
@SubscribeEvent
- fun hideFireFromTheTabListBecauseWhoWantsThose(event: SkipTabListLineEvent) {
+ fun onSkipTablistLine(event: SkipTabListLineEvent) {
if (config.hideFiresales && event.lastSubTitle != null && fireSalePattern.matches(event.lastSubTitle.text)) {
event.cancel()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabStringType.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabStringType.kt
index b6b5c36ab..28f831bfe 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabStringType.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabStringType.kt
@@ -11,11 +11,11 @@ enum class TabStringType {
companion object {
fun fromLine(line: String): TabStringType {
- val strippedLine: String = line.removeColor()
- if (strippedLine.startsWith(" ")) {
+ val unformattedLine: String = line.removeColor()
+ if (unformattedLine.startsWith(" ")) {
return TEXT
}
- return if (TabListReader.usernamePattern.matcher(strippedLine).find()) {
+ return if (TabListReader.usernamePattern.matcher(unformattedLine).find()) {
PLAYER
} else {
SUB_TITLE