2013-06-07 21:36:52 +00:00
|
|
|
package biomesoplenty.items;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.Icon;
|
|
|
|
import biomesoplenty.BiomesOPlenty;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
public class ItemSoulManipulator extends Item
|
|
|
|
{
|
2013-06-16 00:30:58 +00:00
|
|
|
private static String[] manipulatorTypes = {"soulmanipulator_empty", "soulmanipulator_ghastlysoul", "soulmanipulator_villager"};
|
2013-06-07 21:36:52 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
private Icon[] textures;
|
|
|
|
|
|
|
|
public ItemSoulManipulator(int par1)
|
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
maxStackSize = 1;
|
|
|
|
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
|
|
|
|
}
|
2013-06-14 12:36:35 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isFull3D()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2013-06-07 21:36:52 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void registerIcons(IconRegister iconRegister)
|
|
|
|
{
|
|
|
|
textures = new Icon[manipulatorTypes.length];
|
|
|
|
|
|
|
|
for (int i = 0; i < manipulatorTypes.length; ++i) {
|
|
|
|
textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+manipulatorTypes[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUnlocalizedName(ItemStack itemStack)
|
|
|
|
{
|
|
|
|
int meta = itemStack.getItemDamage();
|
|
|
|
if (meta < 0 || meta >= manipulatorTypes.length) {
|
|
|
|
meta = 0;
|
|
|
|
}
|
|
|
|
|
2013-06-09 08:15:39 +00:00
|
|
|
return super.getUnlocalizedName() + "." + manipulatorTypes[meta];
|
2013-06-07 21:36:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Icon getIconFromDamage(int meta)
|
|
|
|
{
|
|
|
|
if (meta < 0 || meta >= textures.length) {
|
|
|
|
meta = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return textures[meta];
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
|
|
@Override
|
|
|
|
public void getSubItems(int itemId, CreativeTabs creativeTab, List subTypes)
|
|
|
|
{
|
|
|
|
for(int meta = 0; meta < manipulatorTypes.length; ++meta) {
|
|
|
|
subTypes.add(new ItemStack(itemId, 1, meta));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|