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.

fix: changed armoraccessor behaviour

legoraft 3f5cfd9a a157a817

+8 -8
+2 -2
src/client/java/com/armorhud/armor/ArmorAccessor.java
··· 2 2 3 3 import net.minecraft.client.player.LocalPlayer; 4 4 import net.minecraft.world.entity.EquipmentSlot; 5 - import net.minecraft.world.item.ItemStackTemplate; 5 + import net.minecraft.world.item.ItemStack; 6 6 7 7 public interface ArmorAccessor { 8 8 9 9 default void initialize(LocalPlayer player) { 10 10 } 11 11 12 - ItemStackTemplate getArmorPiece(LocalPlayer player, EquipmentSlot slot); 12 + ItemStack getArmorPiece(LocalPlayer player, EquipmentSlot slot); 13 13 }
+6 -6
src/client/java/com/armorhud/armor/VanillaArmorAccessor.java
··· 1 1 package com.armorhud.armor; 2 2 3 - import net.minecraft.client.network.ClientPlayerEntity; 4 - import net.minecraft.entity.EquipmentSlot; 5 - import net.minecraft.item.ItemStack; 3 + import net.minecraft.client.player.LocalPlayer; 4 + import net.minecraft.world.entity.EquipmentSlot; 5 + import net.minecraft.world.item.ItemStack; 6 6 7 7 public class VanillaArmorAccessor implements ArmorAccessor { 8 8 9 - public ItemStack getArmorPiece(ClientPlayerEntity player, EquipmentSlot slot) { 10 - if (!slot.isArmorSlot()) { 9 + public ItemStack getArmorPiece(LocalPlayer player, EquipmentSlot slot) { 10 + if (!slot.isArmor()) { 11 11 throw new IllegalArgumentException("Invalid slot type: " + slot); 12 12 } 13 13 14 - return player.getEquippedStack(slot); 14 + return player.getItemBySlot(slot); 15 15 } 16 16 }