-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
- Loading branch information
1 parent
2e44956
commit 60cb082
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/at/hannibal2/skyhanni/features/misc/InWaterDisplay.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |