From 82e05af00194e3732c1b18eb7ddf4844ec7862c3 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 7 May 2021 11:53:57 +0200 Subject: [PATCH] Fix HudHandler.kt on forge --- .../main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt | 2 ++ .../main/kotlin/fr/username404/snowygui/forge/HudHandler.kt | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) 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)