2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.items;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2013-08-27 01:09:03 +10:00
|
|
|
import cpw.mods.fml.common.Loader;
|
|
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.common.TContent;
|
|
|
|
|
import tconstruct.library.util.IToolPart;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2013-08-27 01:09:03 +10:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
public class Bowstring extends CraftingItem implements IToolPart
|
|
|
|
|
{
|
|
|
|
|
public Bowstring(int id)
|
|
|
|
|
{
|
|
|
|
|
super(id, toolMaterialNames, buildTextureNames("_bowstring"), "parts/");
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-27 01:09:03 +10:00
|
|
|
public static final String[] toolMaterialNames = new String[] { "string", "enchantedfabric", "flamestring" };
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2013-08-27 01:09:03 +10:00
|
|
|
public static final String[] toolTextureNames = new String[] { "string", "magicfabric", "flamestring" };
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getMaterialID (ItemStack stack)
|
|
|
|
|
{
|
|
|
|
|
return stack.getItemDamage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getSubItems (int id, CreativeTabs tab, List list)
|
|
|
|
|
{
|
|
|
|
|
list.add(new ItemStack(id, 1, 0));
|
|
|
|
|
if (TContent.thaumcraftAvailable)
|
|
|
|
|
list.add(new ItemStack(id, 1, 1));
|
2013-08-27 01:09:03 +10:00
|
|
|
if (Loader.isModLoaded("Natura"))
|
|
|
|
|
list.add(new ItemStack(id, 1, 2));
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|