Mekanism-tilera-Edition/common/mekanism/tools/item/ItemMekanismArmor.java
2013-10-18 07:33:27 -04:00

38 lines
1.2 KiB
Java

package mekanism.tools.item;
import java.util.List;
import mekanism.common.Mekanism;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemMekanismArmor extends ItemArmor
{
public ItemMekanismArmor(int id, EnumArmorMaterial enumarmormaterial, int renderIndex, int armorType)
{
super(id, enumarmormaterial, renderIndex, armorType);
setCreativeTab(Mekanism.tabMekanism);
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
{
list.add("HP: " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
}
@Override
public void registerIcons(IconRegister register)
{
itemIcon = register.registerIcon("mekanism:" + getUnlocalizedName().replace("item.", ""));
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
return "mekanism:armor/" + getArmorMaterial().name().toLowerCase() + "_" + layer + ".png";
}
}