package zenith.zov.utility.mixin.client.render.gui.hud;

import net.minecraft.client.gui.hud.InGameOverlayRenderer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.math.MatrixStack;
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;
import zenith.zov.client.modules.impl.render.NoRender;

@Mixin({InGameOverlayRenderer.class})
public class GameOverlayRendererMixin {
    @Inject(
        method = {"renderFireOverlay"},
        at = {@At("HEAD")},
        cancellable = true
    )
    private static void removeFireOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
        if (NoRender.INSTANCE.isRemoveFire()) {
            ci.cancel();
        }
    }
}
