Code:
package net.minecraft.src;
public class mod_xyz extends BaseMod{
public static final Item itemsaphire = new Item(164).setItemName("itemsaphire").setTabToDisplayOn(CreativeTabs.tabMaterials);
public static final Item helmetsaphire = (new mod_ItemArmor(168, mod_EnumArmorMaterial.SAPHIRE, ModLoader.addArmor("saphire"), 0)).setItemName("helmetsaphire");
public static final Item platesaphire = (new mod_ItemArmor(169, mod_EnumArmorMaterial.SAPHIRE, ModLoader.addArmor("saphire"), 1)).setItemName("chestplatesaphire");
public static final Item legssaphire = (new mod_ItemArmor(170, mod_EnumArmorMaterial.SAPHIRE, ModLoader.addArmor("saphire"), 2)).setItemName("leggingssaphire");
public static final Item bootssaphire = (new mod_ItemArmor(171, mod_EnumArmorMaterial.SAPHIRE, ModLoader.addArmor("saphire"), 3)).setItemName("bootssaphire");
public void load(){
ModLoader.addName(itemsaphire, "Saphir");
itemsaphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/xyz/itemsaphire.png");
ModLoader.addName(helmetsaphire, "Saphirhelm");
helmetsaphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/xyz/helmetsaphire.png");
ModLoader.addName(platesaphire, "Saphirbrustpanzer");
platesaphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/xyz/platesaphire.png");
ModLoader.addName(legssaphire, "Saphirhose");
legssaphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/xyz/legssaphire.png");
ModLoader.addName(bootssaphire, "Saphirstiefel");
bootssaphire.iconIndex = ModLoader.addOverride("/gui/items.png", "/xyz/bootssaphire.png");
ModLoader.addRecipe(new ItemStack(helmetsaphire, 1), new Object[]{"+++","+#+","###",Character.valueOf('+'), itemsaphire});
ModLoader.addRecipe(new ItemStack(platesaphire, 1), new Object[]{"+#+","+++","+++",Character.valueOf('+'), itemsaphire});
ModLoader.addRecipe(new ItemStack(legssaphire, 1), new Object[]{"+++","+#+","+#+",Character.valueOf('+'), itemsaphire});
ModLoader.addRecipe(new ItemStack(bootssaphire, 1), new Object[]{"###","+#+","+#+",Character.valueOf('+'), itemsaphire});
}
@Override
public String getVersion() {
return "1.3.2";
}
}
Code:
package net.minecraft.src;
public enum mod_EnumArmorMaterial
{
SAPHIRE(5, new int[]{5, 10, 8, 5}, 15),
/**
* Holds the maximum damage factor (each piece multiply this by it's own value) of the material, this is the item
* damage (how much can absorb before breaks)
*/
private int maxDamageFactor;
/**
* Holds the damage reduction (each 1 points is half a shield on gui) of each piece of armor (helmet, plate, legs
* and boots)
*/
private int[] damageReductionAmountArray;
/** Return the enchantability factor of the material */
private int enchantability;
private mod_EnumArmorMaterial(int par3, int[] par4ArrayOfInteger, int par5)
{
this.maxDamageFactor = par3;
this.damageReductionAmountArray = par4ArrayOfInteger;
this.enchantability = par5;
}
/**
* Returns the durability for a armor slot of for this type.
*/
public int getDurability(int par1)
{
return ItemArmor.getMaxDamageArray()[par1] * this.maxDamageFactor;
}
/**
* Return the damage reduction (each 1 point is a half a shield on gui) of the piece index passed (0 = helmet, 1 =
* plate, 2 = legs and 3 = boots)
*/
public int getDamageReductionAmount(int par1)
{
return this.damageReductionAmountArray[par1];
}
/**
* Return the enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
}