diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-26 16:59:42 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-26 16:59:42 +0100 |
commit | 725f1f84dc791c3b31d3917bfe61c69a0b586448 (patch) | |
tree | 7dda266168d6914e0dcc273d460e8851db902895 /src/main/java/at/hannibal2/skyhanni/mixins/hooks | |
parent | d6f4be2ffe855c78d47d86ca4fe6e034c2f30a7c (diff) | |
download | skyhanni-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/at/hannibal2/skyhanni/mixins/hooks')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt | 22 |
1 files changed, 22 insertions, 0 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 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) } |