diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-27 23:39:11 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-27 23:39:11 +0700 |
commit | f1509146f504707dfab3e9abac36038f94040b64 (patch) | |
tree | c1bc7b68627aa43692ba732a75841ef545afa61f /src/main/java/cc/polyfrost/oneconfig/lwjgl | |
parent | 358d5ca1a93b07003c5f45c30364de27a7fc101d (diff) | |
download | OneConfig-f1509146f504707dfab3e9abac36038f94040b64.tar.gz OneConfig-f1509146f504707dfab3e9abac36038f94040b64.tar.bz2 OneConfig-f1509146f504707dfab3e9abac36038f94040b64.zip |
universal events
add mixinextras and keventbus
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/lwjgl')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java index 090121b..a769e12 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java @@ -1,6 +1,11 @@ package cc.polyfrost.oneconfig.lwjgl; +import cc.polyfrost.oneconfig.events.EventManager; +import cc.polyfrost.oneconfig.events.event.RenderEvent; +import cc.polyfrost.oneconfig.events.event.ScreenOpenEvent; +import cc.polyfrost.oneconfig.events.event.Stage; import cc.polyfrost.oneconfig.gui.OneConfigGui; +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; import cc.polyfrost.oneconfig.libs.universal.UMinecraft; import cc.polyfrost.oneconfig.libs.universal.UScreen; import cc.polyfrost.oneconfig.mixin.ShaderGroupAccessor; @@ -9,10 +14,6 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.shader.Shader; import net.minecraft.client.shader.ShaderUniform; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.GuiOpenEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -44,17 +45,17 @@ public class BlurHandler { * Simply initializes the blur mod so events are properly handled by forge. */ public void load() { - MinecraftForge.EVENT_BUS.register(this); + EventManager.INSTANCE.getEventBus().register(this); } - @SubscribeEvent - public void onGuiChange(GuiOpenEvent event) { - reloadBlur(event.gui); + @Subscribe + public void onGuiChange(ScreenOpenEvent event) { + reloadBlur(event.screen); } - @SubscribeEvent - public void onRenderTick(final TickEvent.RenderTickEvent event) { - if (event.phase != TickEvent.Phase.END) { + @Subscribe + public void onRenderTick(RenderEvent event) { + if (event.stage != Stage.END) { return; } |