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.

feat: updated armorhud to use new armoraccessor

+8 -10
+2
src/client/java/com/armorhud/armorHud.java
··· 6 6 import com.armorhud.util.armorHudRegistries; 7 7 import net.fabricmc.api.ClientModInitializer; 8 8 import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 9 + import net.minecraft.client.network.ClientPlayerEntity; 10 + import net.minecraft.item.ItemStack; 9 11 import org.slf4j.Logger; 10 12 import org.slf4j.LoggerFactory; 11 13
+6 -10
src/client/java/com/armorhud/mixin/client/armorHudMixin.java
··· 7 7 import net.minecraft.client.gui.DrawContext; 8 8 import net.minecraft.client.gui.hud.InGameHud; 9 9 import net.minecraft.client.render.RenderTickCounter; 10 + import net.minecraft.entity.EquipmentSlot; 10 11 import net.minecraft.entity.LivingEntity; 11 12 import net.minecraft.entity.player.PlayerEntity; 13 + import net.minecraft.entity.player.PlayerInventory; 12 14 import net.minecraft.item.ItemStack; 13 15 import org.spongepowered.asm.mixin.Final; 14 16 import org.spongepowered.asm.mixin.Mixin; ··· 27 29 28 30 @Shadow public abstract void tick(boolean paused); 29 31 32 + @Shadow private ItemStack currentStack; 30 33 @Unique int armorHeight; 31 34 @Unique boolean initialized; 32 35 ··· 63 66 float x = hungerX - hungerWidth / 2f + barWidth / 2f; 64 67 x += 2; // This makes it look better because the helmet is thinner. 65 68 66 - for (int j = 0; j < pieces; j++) { 67 - x -= armorWidth; 68 - int armorPiece; 69 - 70 - if (config.RTL) { 71 - armorPiece = (pieces - 1) - j; 72 - } else { 73 - armorPiece = j; 69 + for (EquipmentSlot slot : EquipmentSlot.values()) { 70 + if (slot.isArmorSlot()) { 71 + renderArmorPiece(context, x, armorHeight, tickCounter, client.player, armorAccessor.getArmorPiece(client.player, slot)); 74 72 } 75 - 76 - renderArmorPiece(context, x, armorHeight, tickCounter, client.player, armorAccessor.getArmorPiece(client.player, armorPiece)); 77 73 } 78 74 } 79 75