2013-10-08 21:08:46 +11:00
|
|
|
package tconstruct.items;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import cpw.mods.fml.relauncher.*;
|
|
|
|
|
|
|
|
|
|
import tconstruct.library.ItemBlocklike;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import net.minecraft.util.Icon;
|
|
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
public class ArmorPattern extends CraftingItem implements ItemBlocklike
|
|
|
|
|
{
|
2013-10-08 21:08:46 +11:00
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
private Icon baseIcon;
|
|
|
|
|
|
2013-11-23 09:31:19 -05:00
|
|
|
public ArmorPattern(int id, String patternType, String folder)
|
2013-11-10 13:57:35 -08:00
|
|
|
{
|
|
|
|
|
super(id, patternName, getPatternNames(patternType), folder);
|
2013-10-08 21:08:46 +11:00
|
|
|
this.setHasSubtypes(true);
|
|
|
|
|
this.setMaxDamage(0);
|
|
|
|
|
this.setContainerItem(this);
|
|
|
|
|
this.setMaxStackSize(1);
|
2013-11-10 13:57:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected static String[] getPatternNames (String partType)
|
|
|
|
|
{
|
2013-10-08 21:08:46 +11:00
|
|
|
String[] names = new String[patternName.length];
|
|
|
|
|
for (int i = 0; i < patternName.length; i++)
|
|
|
|
|
names[i] = partType + patternName[i];
|
|
|
|
|
return names;
|
|
|
|
|
}
|
2013-11-10 13:57:35 -08:00
|
|
|
|
|
|
|
|
public Icon getBaseIcon ()
|
|
|
|
|
{
|
|
|
|
|
return baseIcon;
|
2013-10-08 21:08:46 +11:00
|
|
|
}
|
2013-11-10 13:57:35 -08:00
|
|
|
|
2013-10-08 21:08:46 +11:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public void registerIcons (IconRegister iconRegister)
|
|
|
|
|
{
|
2013-10-08 21:08:46 +11:00
|
|
|
super.registerIcons(iconRegister);
|
|
|
|
|
baseIcon = iconRegister.registerIcon("tinker:" + folder + "armor_cast");
|
|
|
|
|
}
|
2013-11-10 13:57:35 -08:00
|
|
|
|
2013-10-08 21:08:46 +11:00
|
|
|
private static final String[] patternName = new String[] { "helmet", "chestplate", "leggings", "boots" };
|
|
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
public void getSubItems (int id, CreativeTabs tab, List list)
|
|
|
|
|
{
|
2013-11-23 09:31:19 -05:00
|
|
|
/*for (int i = 0; i < patternName.length; i++)
|
2013-11-10 13:57:35 -08:00
|
|
|
{
|
2013-10-08 21:08:46 +11:00
|
|
|
list.add(new ItemStack(id, 1, i));
|
2013-11-23 09:31:19 -05:00
|
|
|
}*/
|
2013-10-08 21:08:46 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|