-
Notifications
You must be signed in to change notification settings - Fork 755
/
Bowstring.java
54 lines (46 loc) · 1.65 KB
/
Bowstring.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
package tconstruct.items;
import java.util.List;
import cpw.mods.fml.common.Loader;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.util.IToolPart;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class Bowstring extends CraftingItem implements IToolPart
{
public Bowstring()
{
super(toolMaterialNames, buildTextureNames("_bowstring"), "parts/", "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
}
private static String[] buildTextureNames (String textureType)
{
String[] names = new String[toolMaterialNames.length];
for (int i = 0; i < toolMaterialNames.length; i++)
{
if (toolTextureNames[i].equals(""))
names[i] = "";
else
names[i] = toolTextureNames[i] + textureType;
}
return names;
}
public static final String[] toolMaterialNames = new String[] { "string", "enchantedfabric", "flamestring" };
public static final String[] toolTextureNames = new String[] { "string", "magicfabric", "flamestring" };
@Override
public int getMaterialID (ItemStack stack)
{
return stack.getItemDamage();
}
public void getSubItems (Block b, CreativeTabs tab, List list)
{
list.add(new ItemStack(b, 1, 0));
if (TRepo.thaumcraftAvailable)
list.add(new ItemStack(b, 1, 1));
if (Loader.isModLoaded("Natura"))
list.add(new ItemStack(b, 1, 2));
}
}