Add HudHandler.kt

This commit is contained in:
Username404-59 2021-04-28 11:54:24 +02:00
parent c2b87fddbc
commit bd0ac48e11
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 20 additions and 0 deletions

View File

@ -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)
}
}
}