    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 getBlockTextureFromSideAndMetadata(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    public void func_94332_a(IconRegister par1IconRegister)
    080    {
    081        this.field_94406_c = new Icon[field_94405_b.length];
    082
    083        for (int i = 0; i < this.field_94406_c.length; ++i)
    084        {
    085            this.field_94406_c[i] = par1IconRegister.func_94245_a(field_94405_b[i]);
    086        }
    087
    088        this.field_94403_cO = par1IconRegister.func_94245_a("sandstone_top");
    089        this.field_94404_cP = par1IconRegister.func_94245_a("sandstone_bottom");
    090    }
    091}