aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/InWaterDisplay.kt23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/InWaterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/InWaterDisplay.kt
new file mode 100644
index 000000000..f5e15b04a
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/InWaterDisplay.kt
@@ -0,0 +1,23 @@
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.GuiRenderEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings
+import net.minecraft.client.Minecraft
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+object InWaterDisplay {
+
+ private val config get() = SkyHanniMod.feature.misc.stranded
+
+ @SubscribeEvent
+ fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
+ if (!isEnabled()) return
+
+ val text = "§7In Water: " + if (Minecraft.getMinecraft().thePlayer.isInWater) "§aTrue" else "§cFalse"
+ config.inWaterPosition.renderStrings(listOf(text), posLabel = "In Water Display")
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config.inWaterDisplay
+}