aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt20
2 files changed, 10 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java
index b8351feeb..77e497b5e 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java
@@ -214,7 +214,7 @@ public class GardenConfig {
public boolean plotBorders = true;
@Expose
- @ConfigOption(name = "Plot Name in Scoreboard", desc = "Showing a better plot name in scoreboard. Updates faster and doesnt hide when pests are spawned.")
+ @ConfigOption(name = "Plot Name in Scoreboard", desc = "Showing a more compact plot name in scoreboard. Updates faster and doesnt hide when pests are spawned.")
@ConfigEditorBoolean
@FeatureToggle
public boolean plotNameInScoreboard = true;
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 c563008c4..d976eb056 100644
--- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
@@ -21,7 +21,7 @@ fun drawString(
instance.drawString(it, x, y, color)
} ?: 0
-private fun replaceString(text: String, ): String? {
+private fun replaceString(text: String): String? {
if (SkyHanniMod.feature.misc.hideScoreboardNumbers && text.startsWith("§c") && text.length <= 4) {
return null
}
@@ -35,18 +35,16 @@ private fun replaceString(text: String, ): String? {
if (SkyHanniMod.feature.garden.plotNameInScoreboard && GardenAPI.inGarden()) {
if (text.contains("⏣")) {
val plot = GardenPlotAPI.getCurrentPlot()
- val pests = if (text.contains("ൠ")) {
- text.last().digitToInt()
- } else 0
- var name = plot?.let {
+ val pestSuffix = if (text.contains("ൠ")) {
+ val pests = text.last().digitToInt()
+ " §7(§4${pests}ൠ§7)"
+ } else ""
+ val name = plot?.let {
if (it.isBarn()) {
- "§aGarden: The Barn"
- } else "§aPlot: §b" + it.name
+ "§aThe Barn"
+ } else "§b" + it.name
} ?: "§aGarden §cOutside"
- if (pests > 0) {
- name = "$name §7(§4${pests}ൠ§7)"
- }
- return " §7⏣ $name"
+ return " §7⏣ $name$pestSuffix"
}
}