aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/mixin/GuiIngameForgeMixin.java
blob: 1774fdce107879747baf708896b9a97e41fa4360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package cc.polyfrost.oneconfig.mixin;

import cc.polyfrost.oneconfig.events.EventManager;
import cc.polyfrost.oneconfig.events.event.HudRenderEvent;
import net.minecraftforge.client.GuiIngameForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(GuiIngameForge.class)
public class GuiIngameForgeMixin {
    @Inject(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/GuiIngameForge;post(Lnet/minecraftforge/client/event/RenderGameOverlayEvent$ElementType;)V", shift = At.Shift.AFTER))
    private void onRenderGameOverlay(float partialTicks, CallbackInfo ci) {
        EventManager.INSTANCE.getEventBus().post(new HudRenderEvent(partialTicks));
    }
}