-
Notifications
You must be signed in to change notification settings - Fork 754
/
ArmorPattern.java
61 lines (50 loc) · 1.74 KB
/
ArmorPattern.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package tconstruct.items;
import java.util.List;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import tconstruct.library.ItemBlocklike;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ArmorPattern extends CraftingItem implements ItemBlocklike
{
private IIcon baseIcon;
public ArmorPattern(int id, String patternType, String folder)
{
super(patternName, getPatternNames(patternType), folder, "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setContainerItem(this);
this.setMaxStackSize(1);
}
protected static String[] getPatternNames (String partType)
{
String[] names = new String[patternName.length];
for (int i = 0; i < patternName.length; i++)
names[i] = partType + patternName[i];
return names;
}
public IIcon getBaseIcon ()
{
return baseIcon;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons (IIconRegister iconRegister)
{
super.registerIcons(iconRegister);
baseIcon = iconRegister.registerIcon("tinker:" + folder + "armor_cast");
}
private static final String[] patternName = new String[] { "helmet", "chestplate", "leggings", "boots" };
public void getSubItems (Block block, CreativeTabs tab, List list)
{
for (int i = 0; i < patternName.length; i++)
{
list.add(new ItemStack(block, 1, i));
}
}
}