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 ItemCanister extends Item implements ISortableItem
{
public static final String[] names = { "tin", // 0
"copper" }; // 1
// protected IIcon[] icons;
public ItemCanister(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;
this.icons = new IIcon[ItemCanister.names.length];
for (final String name : ItemCanister.names)
{
this.icons[i++] = iconRegister.registerIcon(this.getIconString() + "." + name);
}
}*/
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
return this.getUnlocalizedName() + "." + ItemCanister.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 < 2; i++)
{
par3List.add(new ItemStack(par1, 1, i));
}
}
@Override
public int getMetadata(int par1)
{
return par1;
}
@Override
public EnumSortCategoryItem getCategory(int meta)
{
return EnumSortCategoryItem.CANISTER;
}
}