package info.u_team.u_team_core.item.armor;

import info.u_team.u_team_core.api.registry.IURegistryType;
import net.minecraft.entity.Entity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.*;

public class UArmorItem extends ArmorItem implements IURegistryType {
	
	protected final String typeName;
	
	protected final String name;
	
	public UArmorItem(String name, Properties properties, IArmorMaterial material, EquipmentSlotType slot) {
		this(name, null, properties, material, slot);
	}
	
	public UArmorItem(String name, ItemGroup group, Properties properties, IArmorMaterial material, EquipmentSlotType slot) {
		super(material, slot, group == null ? properties : properties.group(group));
		this.typeName = name + "_" + getTypeString(slot);
		this.name = name;
	}
	
	@Override
	public String getEntryName() {
		return typeName;
	}
	
	@Override
	public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) {
		if (!material.getName().equals("invalid")) {
			return null;
		}
		return String.format("%s:textures/models/armor/%s_layer_%d%s.png", getRegistryName().getNamespace(), name, (slot == EquipmentSlotType.LEGS ? 2 : 1), type == null ? "" : String.format("_%s", type));
	}
	
	protected String getTypeString(EquipmentSlotType slot) {
		switch (slot) {
		case HEAD:
			return "helmet";
		case CHEST:
			return "chestplate";
		case LEGS:
			return "leggings";
		case FEET:
			return "boots";
		default:
			return "invalid";
		}
	}
}

@@ -42,68 +42,8 @@
 r;%0A%0A
-import info.u_team.u_team_core.api.registry.IURegistryType;%0A
 impo
@@ -200,71 +200,9 @@
 tem 
-implements IURegistryType %7B%0A%09%0A%09protected final String typeName;
+%7B
 %0A%09%0A%09
@@ -604,135 +604,16 @@
 his.
-typeName = name + %22_%22 + getTypeString(slot);%0A%09%09this.name = name;%0A%09%7D%0A%09%0A%09@Override%0A%09public String getEntryName() %7B%0A%09%09return typeN
+name = n
 ame;

Update UArmorItem and remove old IURegistryType