From bd0ac48e11fc41800c30a95935867a6edf38eb57 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Wed, 28 Apr 2021 11:54:24 +0200 Subject: [PATCH] Add HudHandler.kt --- .../username404/snowygui/forge/HudHandler.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt diff --git a/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt b/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt new file mode 100644 index 0000000..1957b99 --- /dev/null +++ b/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt @@ -0,0 +1,20 @@ +@file:Suppress("UNUSED") +package fr.username404.snowygui.forge + +import fr.username404.snowygui.EventSnowy +import net.minecraftforge.api.distmarker.Dist +import net.minecraftforge.client.event.RenderGameOverlayEvent +import net.minecraftforge.eventbus.api.SubscribeEvent +import net.minecraftforge.fml.common.Mod + +@Mod.EventBusSubscriber(Dist.CLIENT) +object HudHandler: EventSnowy { + override val type: String = "HudRender" + @SubscribeEvent + @JvmStatic + fun handleRendering(event: RenderGameOverlayEvent.Post) { + if (event.type == RenderGameOverlayEvent.ElementType.ALL) { + fire(event.matrixStack) + } + } +} \ No newline at end of file