From f1509146f504707dfab3e9abac36038f94040b64 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Fri, 27 May 2022 23:39:11 +0700 Subject: universal events add mixinextras and keventbus --- src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/hud') diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java b/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java index 87336e9..200d403 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java @@ -1,8 +1,8 @@ package cc.polyfrost.oneconfig.hud; +import cc.polyfrost.oneconfig.events.event.HudRenderEvent; +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; import cc.polyfrost.oneconfig.libs.universal.UResolution; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; @@ -10,9 +10,9 @@ public class HudCore { public static ArrayList huds = new ArrayList<>(); public static boolean editing = false; - @SubscribeEvent - public void onRender(RenderGameOverlayEvent.Post event) { - if (event.type != RenderGameOverlayEvent.ElementType.ALL || editing) return; + @Subscribe + public void onRender(HudRenderEvent event) { + if (editing) return; for (BasicHud hud : huds) { if (hud.enabled) hud.drawAll(hud.getXScaled(UResolution.getScaledWidth()), hud.getYScaled(UResolution.getScaledHeight()), hud.scale, true); -- cgit