diff --git a/forge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt b/forge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt index 1a899a1..79a7cfd 100644 --- a/forge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt +++ b/forge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt @@ -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) } } \ No newline at end of file diff --git a/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt b/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt index 1957b99..4d06496 100644 --- a/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt +++ b/forge/src/main/kotlin/fr/username404/snowygui/forge/HudHandler.kt @@ -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)