aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-26 16:59:42 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-26 16:59:42 +0100
commit725f1f84dc791c3b31d3917bfe61c69a0b586448 (patch)
tree7dda266168d6914e0dcc273d460e8851db902895 /src/main/java
parentd6f4be2ffe855c78d47d86ca4fe6e034c2f30a7c (diff)
downloadskyhanni-725f1f84dc791c3b31d3917bfe61c69a0b586448.tar.gz
skyhanni-725f1f84dc791c3b31d3917bfe61c69a0b586448.tar.bz2
skyhanni-725f1f84dc791c3b31d3917bfe61c69a0b586448.zip
Showing a better plot name in scoreboard. Updates faster and doesnt hide when pests are spawned.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt22
2 files changed, 28 insertions, 0 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 5b8485e77..b8351feeb 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,6 +214,12 @@ 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.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean plotNameInScoreboard = true;
+
+ @Expose
@ConfigOption(name = "Copy Milestone Data", desc = "Copy wrong crop milestone data in clipboard when opening the crop milestone menu. Please share this data in SkyHanni discord.")
@ConfigEditorBoolean
@FeatureToggle
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 7fb80d4e0..eeae056b4 100644
--- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt
@@ -1,6 +1,10 @@
package at.hannibal2.skyhanni.mixins.hooks
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.features.garden.GardenAPI
+import at.hannibal2.skyhanni.features.garden.GardenPlotAPI
+import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.isBarn
+import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.name
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import net.minecraft.client.gui.FontRenderer
@@ -24,5 +28,23 @@ fun drawString(
}
}
+ 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 {
+ if (it.isBarn()) {
+ "§aGarden: The Barn"
+ } else "§aPlot: §b" + it.name
+ } ?: "§aGarden §cOutside"
+ if (pests > 0) {
+ name = "$name §7(§4${pests}ൠ§7)"
+ }
+ return instance.drawString(" §7⏣ $name", x, y, color)
+ }
+ }
+
return instance.drawString(text, x, y, color)
}