From 7c66f02ddbc8e68f3f6b22d69a9120da231405fe Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 28 Nov 2023 00:00:00 +0100 Subject: Added the "plot" word to the sidebar again (only if no pest on garden). --- .../java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2') 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" } } -- cgit