BiomesOPlenty/src/minecraft/biomesoplenty/armor/ArmorAmethyst.java

52 lines
1.8 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty.armor;
import net.minecraft.client.renderer.texture.IconRegister;
2013-07-01 00:31:34 +00:00
import net.minecraft.entity.Entity;
2013-05-03 13:00:44 +00:00
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Items;
2013-07-01 00:31:34 +00:00
public class ArmorAmethyst extends ItemArmor
2013-05-03 13:00:44 +00:00
{
public int textureID = 0;
2013-05-31 10:34:02 +00:00
2013-07-01 00:31:34 +00:00
public ArmorAmethyst(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
{
2013-05-03 13:00:44 +00:00
super(par1, par2EnumArmorMaterial, par3, par4);
textureID = par4;
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
2013-05-31 10:34:02 +00:00
@Override
2013-05-31 10:34:02 +00:00
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
if (par2ItemStack.itemID == Items.miscItems.get().itemID && par2ItemStack.getItemDamage() == 2)
return true;
2013-07-01 00:31:34 +00:00
return false;
2013-05-31 10:34:02 +00:00
}
@Override
2013-07-01 00:31:34 +00:00
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
if (stack.itemID == Items.helmetAmethyst.get().itemID || stack.itemID == Items.chestplateAmethyst.get().itemID || stack.itemID == Items.bootsAmethyst.get().itemID)
return "biomesoplenty:textures/armor/amethyst_1.png";
2013-07-01 00:31:34 +00:00
if (stack.itemID == Items.leggingsAmethyst.get().itemID)
return "biomesoplenty:textures/armor/amethyst_2.png";
2013-07-01 00:31:34 +00:00
2013-05-03 13:00:44 +00:00
return null;
}
2013-05-31 10:34:02 +00:00
@Override
2013-05-03 13:00:44 +00:00
public void registerIcons(IconRegister iconRegister)
{
if (textureID == 0) { itemIcon = iconRegister.registerIcon("biomesoplenty:amethysthelmet"); }
else if (textureID == 1) { itemIcon = iconRegister.registerIcon("biomesoplenty:amethystchestplate"); }
else if (textureID == 2) { itemIcon = iconRegister.registerIcon("biomesoplenty:amethystleggings"); }
else if (textureID == 3) { itemIcon = iconRegister.registerIcon("biomesoplenty:amethystboots"); }
else { itemIcon = iconRegister.registerIcon("biomesoplenty:mudball"); }
2013-05-03 13:00:44 +00:00
}
}