package com.iblowuptnt.tntMods.item;

import com.google.common.collect.Sets;
import com.iblowuptnt.tntMods.creativetab.CreativeTab;
import com.iblowuptnt.tntMods.reference.Material;
import com.iblowuptnt.tntMods.reference.Name;
import com.iblowuptnt.tntMods.reference.Textures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemSpade;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;


import java.util.Set;



public class ItemCompShovel extends ItemSpade
{
    public ItemCompShovel()
    {
        super(Material.Tools.COMP_DIAMOND);
        this.setCreativeTab(CreativeTab.TNT_TAB);
        this.setUnlocalizedName(Name.Tools.COMP_SHOVEL);
        this.maxStackSize = 1;
    }
    protected String getUnwrappedUnlocalizedName(String unlocalizedName)
    {
        return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
    }

    @Override
    public String getUnlocalizedName()
    {
        return String.format("item.%s%s", Textures.MOD_ID_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
    }

    @Override
    public String getUnlocalizedName(ItemStack itemStack)
    {
        return String.format("item.%s%s", Textures.MOD_ID_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
    }

    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister iconRegister)
    {
        itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
    }
}
