diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/garden/GardenConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt | 22 |
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) } |