2013-08-27 00:49:32 +02:00
|
|
|
package mekanism.tools.item;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-11-15 21:04:12 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
2013-12-16 18:21:49 +01:00
|
|
|
import mekanism.client.render.ModelCustomArmor;
|
2012-11-25 16:45:00 +01:00
|
|
|
import mekanism.common.Mekanism;
|
2013-12-16 18:21:49 +01:00
|
|
|
import mekanism.tools.common.MekanismTools;
|
|
|
|
import net.minecraft.client.model.ModelBiped;
|
2013-03-18 17:23:57 +01:00
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
2013-07-27 00:16:21 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
2013-12-16 18:21:49 +01:00
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.item.EnumArmorMaterial;
|
|
|
|
import net.minecraft.item.ItemArmor;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2013-12-16 18:21:49 +01:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-11-05 20:29:04 +01:00
|
|
|
public class ItemMekanismArmor extends ItemArmor
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2014-03-08 02:00:25 +01:00
|
|
|
public ItemMekanismArmor(int id, EnumArmorMaterial enumarmormaterial, int renderIndex, int armorType)
|
|
|
|
{
|
|
|
|
super(id, enumarmormaterial, renderIndex, armorType);
|
|
|
|
setCreativeTab(Mekanism.tabMekanism);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2012-11-15 21:04:12 +01:00
|
|
|
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
|
|
|
{
|
|
|
|
list.add("HP: " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-03-18 17:23:57 +01:00
|
|
|
@Override
|
2013-04-13 02:25:21 +02:00
|
|
|
public void registerIcons(IconRegister register)
|
2012-11-06 16:44:14 +01:00
|
|
|
{
|
2013-04-13 02:25:21 +02:00
|
|
|
itemIcon = register.registerIcon("mekanism:" + getUnlocalizedName().replace("item.", ""));
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-07-27 00:16:21 +02:00
|
|
|
@Override
|
2014-03-08 02:00:25 +01:00
|
|
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
|
|
|
|
{
|
2013-10-18 13:33:27 +02:00
|
|
|
return "mekanism:armor/" + getArmorMaterial().name().toLowerCase() + "_" + layer + ".png";
|
2014-03-08 02:00:25 +01:00
|
|
|
}
|
|
|
|
|
2013-12-16 18:21:49 +01:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2014-03-08 02:00:25 +01:00
|
|
|
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot)
|
|
|
|
{
|
2013-12-16 18:21:49 +01:00
|
|
|
if(itemStack.itemID == MekanismTools.GlowstoneHelmet.itemID || itemStack.itemID == MekanismTools.GlowstoneChestplate.itemID ||
|
|
|
|
itemStack.itemID == MekanismTools.GlowstoneLeggings.itemID || itemStack.itemID == MekanismTools.GlowstoneBoots.itemID)
|
|
|
|
{
|
|
|
|
return ModelCustomArmor.getGlow(armorSlot);
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-12-16 18:21:49 +01:00
|
|
|
return super.getArmorModel(entityLiving, itemStack, armorSlot);
|
2014-03-08 02:00:25 +01:00
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|