A mod that adds your armor to the hud modrinth.com/mod/simple-armor-hud
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Refactor inGameHudMixin to use Gui class

authored by

rh4htr and committed by
GitHub
10891494 aed52d19

+6 -6
+6 -6
src/client/java/com/armorhud/mixin/client/inGameHudMixin.java
··· 1 1 package com.armorhud.mixin.client; 2 2 3 3 import com.armorhud.config.config; 4 - import net.minecraft.client.gui.DrawContext; 5 - import net.minecraft.client.gui.hud.InGameHud; 6 - import net.minecraft.entity.player.PlayerEntity; 4 + import net.minecraft.client.gui.GuiGraphicsExtractor; 5 + import net.minecraft.client.gui.Gui; 6 + import net.minecraft.world.entity.player.Player; 7 7 import org.jetbrains.annotations.Nullable; 8 8 import org.spongepowered.asm.mixin.Mixin; 9 9 import org.spongepowered.asm.mixin.Shadow; ··· 12 12 import org.spongepowered.asm.mixin.injection.ModifyVariable; 13 13 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 14 15 - @Mixin(InGameHud.class) 15 + @Mixin(Gui.class) 16 16 17 17 public abstract class inGameHudMixin { 18 18 19 - @Inject(method = "renderArmor", at=@At("HEAD"), cancellable = true) 20 - private static void checkArmor(DrawContext context, PlayerEntity player, int i, int j, int k, int x, CallbackInfo ci) { 19 + @Inject(method = "extractArmor", at=@At("HEAD"), cancellable = true) 20 + private static void checkArmor(GuiGraphicsExtractor context, Player player, int i, int j, int k, int x, CallbackInfo ci) { 21 21 if (config.DISABLE_ARMOR_BAR) { 22 22 ci.cancel(); 23 23 }