content: package com.github.alexthe666.iceandfire.item;
  
  import com.github.alexthe666.citadel.server.item.CustomArmorMaterial;
  import com.github.alexthe666.iceandfire.IceAndFire;
  import com.github.alexthe666.iceandfire.client.model.armor.ModelTrollArmor;
  import com.github.alexthe666.iceandfire.enums.EnumTroll;
  import net.minecraft.ChatFormatting;
  import net.minecraft.client.model.HumanoidModel;
  import net.minecraft.network.chat.Component;
  import net.minecraft.network.chat.TranslatableComponent;
  import net.minecraft.world.entity.Entity;
  import net.minecraft.world.entity.EquipmentSlot;
  import net.minecraft.world.entity.LivingEntity;
  import net.minecraft.world.item.*;
  import net.minecraft.world.level.Level;
  import org.jetbrains.annotations.NotNull;
  
  import javax.annotation.Nullable;
  import java.util.List;
  import java.util.Locale;
  
  public class ItemTrollArmor extends ArmorItem{
  
      public EnumTroll troll;
  
      public ItemTrollArmor(EnumTroll troll, CustomArmorMaterial material, EquipmentSlot slot) {
          super(material, slot, new Item.Properties().tab(IceAndFire.TAB_ITEMS));
          this.troll = troll;
      }
  
      public static String getName(EnumTroll troll, EquipmentSlot slot) {
          return "%s_troll_leather_%s".formatted(troll.name().toLowerCase(Locale.ROOT), getArmorPart(slot));
      }
  
      @Override
      public @NotNull ArmorMaterial getMaterial() {
          return troll.material;
      }
  
  
      private static String getArmorPart(EquipmentSlot slot) {
          return switch (slot) {
              case HEAD -> "helmet";
              case CHEST -> "chestplate";
              case LEGS -> "leggings";
              case FEET -> "boots";
              default -> "";
          };
      }
  
      @Override
      public void initializeClient(java.util.function.Consumer<net.minecraftforge.client.IItemRenderProperties> consumer) {
          consumer.accept(new net.minecraftforge.client.IItemRenderProperties() {
              @Override
              @Nullable
              public HumanoidModel<?> getArmorModel(LivingEntity LivingEntity, ItemStack itemStack, EquipmentSlot armorSlot, HumanoidModel<?> _default) {
                  return new ModelTrollArmor(armorSlot == EquipmentSlot.LEGS || armorSlot == EquipmentSlot.HEAD);
              }
          });
      }
  
      @Override
      public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) {
          return "iceandfire:textures/models/armor/armor_troll_" + troll.name().toLowerCase(Locale.ROOT) + (slot == EquipmentSlot.LEGS ? "_legs.png" : ".png");
      }
  
      @Override
      public void appendHoverText(@NotNull ItemStack stack, @Nullable Level worldIn, List<Component> tooltip, @NotNull TooltipFlag flagIn) {
          tooltip.add(new TranslatableComponent("item.iceandfire.troll_leather_armor_" + getArmorPart(slot) + ".desc").withStyle(ChatFormatting.GREEN));
      }
  }
  