package micdoodle8.mods.galacticraft.core.items;
import micdoodle8.mods.galacticraft.core.GalacticraftCore;
import micdoodle8.mods.galacticraft.core.proxy.ClientProxyCore;
import micdoodle8.mods.galacticraft.core.util.EnumSortCategoryItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class ItemRocketEngineGC extends Item implements ISortableItem
{
public static final String[] names = { "tier1engine", // 0
"tier1booster" }; // 1
// protected IIcon[] icons = new IIcon[ItemRocketEngineGC.names.length];
public ItemRocketEngineGC(String assetName)
{
super();
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setUnlocalizedName(assetName);
//this.setTextureName(Constants.TEXTURE_PREFIX + assetName);
}
@Override
public CreativeTabs getCreativeTab()
{
return GalacticraftCore.galacticraftItemsTab;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
return ClientProxyCore.galacticraftItem;
}
/*@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
int i = 0;
for (final String name : ItemRocketEngineGC.names)
{
this.icons[i++] = iconRegister.registerIcon(this.getIconString() + "." + name);
}
}*/
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
return this.getUnlocalizedName() + "." + ItemRocketEngineGC.names[itemStack.getItemDamage()];
}
/*@Override
public IIcon getIconFromDamage(int damage)
{
if (this.icons.length > damage)
{
return this.icons[damage];
}
return super.getIconFromDamage(damage);
}*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < ItemRocketEngineGC.names.length; i++)
{
par3List.add(new ItemStack(par1, 1, i));
}
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
public EnumSortCategoryItem getCategory(int meta)
{
return EnumSortCategoryItem.GENERAL;
}
}