Skip to content

Commit

Permalink
fix some events not being posted
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jul 7, 2024
1 parent 799493c commit fc483ea
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.ForgeHooks;
import org.lwjgl.opengl.GL11;
import org.polyfrost.vanillahud.VanillaHUD;
Expand All @@ -28,6 +29,8 @@

import java.util.Random;

import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.FOOD;
import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.HEALTHMOUNT;
import static org.polyfrost.vanillahud.hud.Health.healthLink;
import static org.polyfrost.vanillahud.hud.Hunger.*;

Expand All @@ -49,6 +52,8 @@ public abstract class GuiIngameForgeMixin {
@Shadow
public static boolean renderFood;

@Shadow protected abstract void post(RenderGameOverlayEvent.ElementType type);

@ModifyArgs(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/GuiIngameForge;renderAir(II)V"))
private void air(Args args) {
if (VanillaHUD.isApec()) {
Expand Down Expand Up @@ -338,6 +343,7 @@ private void hungerCancel(int width, int height, CallbackInfo ci) {
}
if (!(renderFood || Hunger.mountHud.isEnabled())) {
ci.cancel();
post(FOOD);
}
}

Expand Down Expand Up @@ -446,6 +452,7 @@ private void mount(CallbackInfo ci) {
}
if (!(renderHealthMount || Hunger.mountHud.isEnabled())) {
ci.cancel();
post(HEALTHMOUNT);
return;
}
Hud hud = getMountHud();
Expand Down

0 comments on commit fc483ea

Please sign in to comment.