001package net.minecraft.block;
002
003import cpw.mods.fml.relauncher.Side;
004import cpw.mods.fml.relauncher.SideOnly;
005import java.util.List;
006import net.minecraft.block.material.Material;
007import net.minecraft.client.renderer.texture.IconRegister;
008import net.minecraft.creativetab.CreativeTabs;
009import net.minecraft.item.ItemStack;
010import net.minecraft.util.Icon;
011
012public class BlockSandStone extends Block
013{
014    public static final String[] SAND_STONE_TYPES = new String[] {"default", "chiseled", "smooth"};
015    private static final String[] field_94405_b = new String[] {"sandstone_side", "sandstone_carved", "sandstone_smooth"};
016    @SideOnly(Side.CLIENT)
017    private Icon[] field_94406_c;
018    @SideOnly(Side.CLIENT)
019    private Icon field_94403_cO;
020    @SideOnly(Side.CLIENT)
021    private Icon field_94404_cP;
022
023    public BlockSandStone(int par1)
024    {
025        super(par1, Material.rock);
026        this.setCreativeTab(CreativeTabs.tabBlock);
027    }
028
029    @SideOnly(Side.CLIENT)
030
031    /**
032     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
033     */
034    public Icon getIcon(int par1, int par2)
035    {
036        if (par1 != 1 && (par1 != 0 || par2 != 1 && par2 != 2))
037        {
038            if (par1 == 0)
039            {
040                return this.field_94404_cP;
041            }
042            else
043            {
044                if (par2 < 0 || par2 >= this.field_94406_c.length)
045                {
046                    par2 = 0;
047                }
048
049                return this.field_94406_c[par2];
050            }
051        }
052        else
053        {
054            return this.field_94403_cO;
055        }
056    }
057
058    /**
059     * Determines the damage on the item the block drops. Used in cloth and wood.
060     */
061    public int damageDropped(int par1)
062    {
063        return par1;
064    }
065
066    @SideOnly(Side.CLIENT)
067
068    /**
069     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
070     */
071    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
072    {
073        par3List.add(new ItemStack(par1, 1, 0));
074        par3List.add(new ItemStack(par1, 1, 1));
075        par3List.add(new ItemStack(par1, 1, 2));
076    }
077
078    @SideOnly(Side.CLIENT)
079
080    /**
081     * When this method is called, your block should register all the icons it needs with the given IconRegister. This
082     * is the only chance you get to register icons.
083     */
084    public void registerIcons(IconRegister par1IconRegister)
085    {
086        this.field_94406_c = new Icon[field_94405_b.length];
087
088        for (int i = 0; i < this.field_94406_c.length; ++i)
089        {
090            this.field_94406_c[i] = par1IconRegister.registerIcon(field_94405_b[i]);
091        }
092
093        this.field_94403_cO = par1IconRegister.registerIcon("sandstone_top");
094        this.field_94404_cP = par1IconRegister.registerIcon("sandstone_bottom");
095    }
096}