2013-05-09 10:33:50 +00:00
|
|
|
package biomesoplenty.armor;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2013-07-01 00:31:34 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
2013-05-09 10:33:50 +00:00
|
|
|
import net.minecraft.item.EnumArmorMaterial;
|
|
|
|
import net.minecraft.item.ItemArmor;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.Icon;
|
2013-05-29 01:05:27 +00:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-05-09 10:33:50 +00:00
|
|
|
|
2013-07-01 00:31:34 +00:00
|
|
|
public class ArmorFlowerBand extends ItemArmor
|
2013-05-09 10:33:50 +00:00
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
private static final String[] flowerBandTypes = new String[] {"dullflowerband", "plainflowerband", "lushflowerband", "exoticflowerband"};
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
private Icon[] textures;
|
|
|
|
|
2013-05-09 10:33:50 +00:00
|
|
|
public ArmorFlowerBand(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) {
|
|
|
|
super(par1, par2EnumArmorMaterial, par3, par4);
|
2013-05-31 10:34:02 +00:00
|
|
|
setHasSubtypes(true);
|
2013-05-09 10:33:50 +00:00
|
|
|
setMaxDamage(0);
|
|
|
|
maxStackSize = 8;
|
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < flowerBandTypes.length; ++i)
|
|
|
|
{
|
|
|
|
par3List.add(new ItemStack(par1, 1, i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUnlocalizedName(ItemStack itemStack)
|
|
|
|
{
|
2013-06-09 08:15:39 +00:00
|
|
|
return super.getUnlocalizedName() + "." + (new StringBuilder()).append(flowerBandTypes[itemStack.getItemDamage()]).toString();
|
2013-05-31 10:34:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public void registerIcons(IconRegister iconRegister)
|
|
|
|
{
|
|
|
|
textures = new Icon[flowerBandTypes.length];
|
|
|
|
|
|
|
|
for (int i = 0; i < flowerBandTypes.length; ++i) {
|
2013-07-03 06:01:28 +00:00
|
|
|
textures[i] = iconRegister.registerIcon("biomesoplenty:" + flowerBandTypes[i]);
|
2013-05-31 10:34:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Icon getIconFromDamage(int meta)
|
|
|
|
{
|
|
|
|
return textures[meta];
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2013-08-16 10:00:45 +00:00
|
|
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
2013-07-01 00:31:34 +00:00
|
|
|
if (stack.getItemDamage() == 0)
|
2013-07-03 06:01:28 +00:00
|
|
|
return "biomesoplenty:textures/armor/dullflowerband.png";
|
2013-05-31 10:34:02 +00:00
|
|
|
|
2013-07-01 00:31:34 +00:00
|
|
|
if (stack.getItemDamage() == 1)
|
2013-07-03 06:01:28 +00:00
|
|
|
return "biomesoplenty:textures/armor/plainflowerband.png";
|
2013-05-31 10:34:02 +00:00
|
|
|
|
2013-07-01 00:31:34 +00:00
|
|
|
if (stack.getItemDamage() == 2)
|
2013-07-03 06:01:28 +00:00
|
|
|
return "biomesoplenty:textures/armor/lushflowerband.png";
|
2013-05-31 10:34:02 +00:00
|
|
|
|
2013-07-01 00:31:34 +00:00
|
|
|
if (stack.getItemDamage() == 3)
|
2013-07-03 06:01:28 +00:00
|
|
|
return "biomesoplenty:textures/armor/exoticflowerband.png";
|
2013-05-31 10:34:02 +00:00
|
|
|
|
2013-05-09 10:33:50 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|