aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-28 00:00:00 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-28 00:00:00 +0100
commit7c66f02ddbc8e68f3f6b22d69a9120da231405fe (patch)
tree41d42c52ad52e641c7163fe302801fa16fa932e1 /src/main/java
parented60244b647171ef449e3d7336d15830d851fc4a (diff)
downloadskyhanni-7c66f02ddbc8e68f3f6b22d69a9120da231405fe.tar.gz
skyhanni-7c66f02ddbc8e68f3f6b22d69a9120da231405fe.tar.bz2
skyhanni-7c66f02ddbc8e68f3f6b22d69a9120da231405fe.zip
Added the "plot" word to the sidebar again (only if no pest on garden).
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
index 4785c0da2..8eb8442cd 100644
--- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
@@ -35,13 +35,17 @@ private fun replaceString(text: String): String? {
if (SkyHanniMod.feature.garden.plotNameInScoreboard && GardenAPI.inGarden()) {
if (text.contains("⏣")) {
val plot = GardenPlotAPI.getCurrentPlot()
- val pestSuffix = if (text.contains("ൠ")) {
+ val hasPests = text.contains("ൠ")
+ val pestSuffix = if (hasPests) {
val pests = text.last().digitToInt()
" §7(§4${pests}ൠ§7)"
} else ""
val name = plot?.let {
- if (it.isBarn()) "§aThe Barn" else "§b" + it.name
- } ?: "§aGarden §cOutside"
+ if (it.isBarn()) "§aThe Barn" else {
+ val namePrefix = if (hasPests) "" else "§aPlot §7- "
+ "$namePrefix§b" + it.name
+ }
+ } ?: "§aGarden §coutside"
return " §7⏣ $name$pestSuffix"
}
}