aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt
diff options
context:
space:
mode:
authorObsidian <108832807+Obsidianninja11@users.noreply.github.com>2024-03-04 10:59:15 -0900
committerGitHub <noreply@github.com>2024-03-04 20:59:15 +0100
commit16facf4a91651c709e4c78e7b3f2c9973560feab (patch)
treea906f9ca75bee7296158c07399348952b1e9ec71 /src/main/java/at/hannibal2/skyhanni/data/RenderData.kt
parente52c3015102bc308f3536c377eb56d99d8f83b20 (diff)
downloadskyhanni-16facf4a91651c709e4c78e7b3f2c9973560feab.tar.gz
skyhanni-16facf4a91651c709e4c78e7b3f2c9973560feab.tar.bz2
skyhanni-16facf4a91651c709e4c78e7b3f2c9973560feab.zip
Feature: Added option to show some features outside SB. (#603)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/RenderData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/RenderData.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt
index 2ca07b16c..f8e8f37da 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt
@@ -21,6 +21,7 @@ class RenderData {
@SubscribeEvent
fun onRenderOverlay(event: RenderGameOverlayEvent.Pre) {
if (event.type != RenderGameOverlayEvent.ElementType.HOTBAR) return
+ if (!canRender()) return
if (!SkyHanniDebugsAndTests.globalRender) return
if (GuiEditManager.isInGui() || VisualWordGui.isInGui()) return
@@ -31,6 +32,7 @@ class RenderData {
@SubscribeEvent
fun onBackgroundDraw(event: GuiScreenEvent.BackgroundDrawnEvent) {
+ if (!canRender()) return
if (!SkyHanniDebugsAndTests.globalRender) return
if (GuiEditManager.isInGui() || VisualWordGui.isInGui()) return
val currentScreen = Minecraft.getMinecraft().currentScreen ?: return
@@ -50,6 +52,8 @@ class RenderData {
GlStateManager.popMatrix()
}
+ private fun canRender(): Boolean = Minecraft.getMinecraft()?.renderManager?.fontRenderer != null
+
@SubscribeEvent
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!SkyHanniDebugsAndTests.globalRender) return