diff --git a/src/main/java/mcjty/theoneprobe/items/ModItems.java b/src/main/java/mcjty/theoneprobe/items/ModItems.java index 2d24be56..06c48cf7 100644 --- a/src/main/java/mcjty/theoneprobe/items/ModItems.java +++ b/src/main/java/mcjty/theoneprobe/items/ModItems.java @@ -59,9 +59,9 @@ public static void init() { 15, new int[]{2, 5, 6, 2}, 9, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F); bar.step("Creating Armor Probes"); - diamondHelmetProbe = makeHelmet(materialDiamondHelmet, 3, "diamond_helmet_probe", 1); - goldHelmetProbe = makeHelmet(materialGoldHelmet, 4, "gold_helmet_probe", 2); - ironHelmetProbe = makeHelmet(materialIronHelmet, 2, "iron_helmet_probe", 3); + diamondHelmetProbe = makeHelmet(materialDiamondHelmet, 3, "diamond_helmet_probe", "minecraft:textures/models/armor/diamond_layer_1.png"); + goldHelmetProbe = makeHelmet(materialGoldHelmet, 4, "gold_helmet_probe", "minecraft:textures/models/armor/gold_layer_1.png"); + ironHelmetProbe = makeHelmet(materialIronHelmet, 2, "iron_helmet_probe", "minecraft:textures/models/armor/iron_layer_1.png"); bar.step("Initializing Probe Note"); probeNote = new ProbeNote(); @@ -74,8 +74,8 @@ public static void init() { ProgressManager.pop(bar); } - private static Item makeHelmet(ItemArmor.ArmorMaterial material, int renderIndex, String name, int type) { - Item item = new ProbeArmor(material, renderIndex, EntityEquipmentSlot.HEAD, type) { + private static Item makeHelmet(ItemArmor.ArmorMaterial material, int renderIndex, String name, String baseTexture) { + Item item = new ProbeArmor(material, renderIndex, EntityEquipmentSlot.HEAD, baseTexture) { @Override public boolean getHasSubtypes() { return true; diff --git a/src/main/java/mcjty/theoneprobe/items/ProbeArmor.java b/src/main/java/mcjty/theoneprobe/items/ProbeArmor.java index 57724a21..2e7b585a 100644 --- a/src/main/java/mcjty/theoneprobe/items/ProbeArmor.java +++ b/src/main/java/mcjty/theoneprobe/items/ProbeArmor.java @@ -8,11 +8,11 @@ public class ProbeArmor extends ItemArmor { - private int armorType; + private String baseTexture; - public ProbeArmor(ArmorMaterial material, int renderIndex, EntityEquipmentSlot equipmentSlot, int armorType) { + public ProbeArmor(ArmorMaterial material, int renderIndex, EntityEquipmentSlot equipmentSlot, String baseTexture) { super(material, renderIndex, equipmentSlot); - this.armorType = armorType; + this.baseTexture = baseTexture; } @Override @@ -28,23 +28,10 @@ public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlo } if (slot == EntityEquipmentSlot.HEAD) { - return getArmorTexture(this.armorType); + return this.baseTexture; } // Call the parent method for layer0 return super.getArmorTexture(stack, entity, slot, type); } - - public String getArmorTexture(int type){ - switch (type){ - case 1: - return "minecraft:textures/models/armor/diamond_layer_1.png"; - case 2: - return "minecraft:textures/models/armor/gold_layer_1.png"; - case 3: - return "minecraft:textures/models/armor/iron_layer_1.png"; - default: - return "minecraft:textures/models/armor/diamond_layer_1.png"; - } - } }