Fix HudHandler.kt on forge

This commit is contained in:
Username404-59 2021-05-07 11:53:57 +02:00
parent 25a5380166
commit 82e05af001
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 2 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import fr.username404.snowygui.config.SnowyConfigScreen
import net.minecraftforge.fml.ExtensionPoint
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent
import thedarkcolour.kotlinforforge.forge.FORGE_BUS
import thedarkcolour.kotlinforforge.forge.LOADING_CONTEXT
import thedarkcolour.kotlinforforge.forge.MOD_BUS
import java.util.function.BiFunction
@ -31,5 +32,6 @@ class ForgeInit: Snowy() {
addListener(this@ForgeInit::initSetup)
addListener(this@ForgeInit::configSetup)
}
FORGE_BUS.register(HudHandler)
}
}

View File

@ -2,16 +2,12 @@
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)