// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/RenderHudCallback.java
// public interface RenderHudCallback {
//     Event<RenderHudCallback> EVENT = Event.create((listeners) ->
//             (stack, partialTicks) -> {
//                 for (RenderHudCallback listener : listeners) {
//                     listener.renderHud(stack, partialTicks);
//                 }
//             }
//     );
// 
//     void renderHud(MatrixStack stack, float partialTicks);
// }


import de.johni0702.minecraft.gui.versions.callbacks.RenderHudCallback;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import org.objectweb.asm.Opcodes;
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;
//#if FABRIC>=1
package de.johni0702.minecraft.gui.versions.mixin;


@Mixin(InGameHud.class)
public class Mixin_RenderHudCallback {
    @Inject(
            method = "render",
            at = @At(
                    value = "FIELD",
                    opcode = Opcodes.GETFIELD,
                    target = "Lnet/minecraft/client/options/GameOptions;debugEnabled:Z"
            )
    )
    //#if MC>=11600
    private void renderOverlay(MatrixStack stack, float partialTicks, CallbackInfo ci) {
    //#else
    //$$ private void renderOverlay(float partialTicks, CallbackInfo ci) {
    //$$     MatrixStack stack = new MatrixStack();
    //#endif
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/RenderHudCallback.java
// public interface RenderHudCallback {
//     Event<RenderHudCallback> EVENT = Event.create((listeners) ->
//             (stack, partialTicks) -> {
//                 for (RenderHudCallback listener : listeners) {
//                     listener.renderHud(stack, partialTicks);
//                 }
//             }
//     );
// 
//     void renderHud(MatrixStack stack, float partialTicks);
// }


// Path: src/main/java/de/johni0702/minecraft/gui/versions/mixin/Mixin_RenderHudCallback.java
import de.johni0702.minecraft.gui.versions.callbacks.RenderHudCallback;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import org.objectweb.asm.Opcodes;
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;

//#if FABRIC>=1
package de.johni0702.minecraft.gui.versions.mixin;


@Mixin(InGameHud.class)
public class Mixin_RenderHudCallback {
    @Inject(
            method = "render",
            at = @At(
                    value = "FIELD",
                    opcode = Opcodes.GETFIELD,
                    target = "Lnet/minecraft/client/options/GameOptions;debugEnabled:Z"
            )
    )
    //#if MC>=11600
    private void renderOverlay(MatrixStack stack, float partialTicks, CallbackInfo ci) {
    //#else
    //$$ private void renderOverlay(float partialTicks, CallbackInfo ci) {
    //$$     MatrixStack stack = new MatrixStack();
    //#endif
        RenderHudCallback.EVENT.invoker().renderHud(stack, partialTicks);