    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 BlockStoneBrick extends Block
    013{
    014    public static final String[] STONE_BRICK_TYPES = new String[] {"default", "mossy", "cracked", "chiseled"};
    015    public static final String[] field_94407_b = new String[] {"stonebricksmooth", "stonebricksmooth_mossy", "stonebricksmooth_cracked", "stonebricksmooth_carved"};
    016    @SideOnly(Side.CLIENT)
    017    private Icon[] field_94408_c;
    018
    019    public BlockStoneBrick(int par1)
    020    {
    021        super(par1, Material.rock);
    022        this.setCreativeTab(CreativeTabs.tabBlock);
    023    }
    024
    025    @SideOnly(Side.CLIENT)
    026
    027    /**
    028     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
    029     */
    030    public Icon getIcon(int par1, int par2)
    031    {
    032        if (par2 < 0 || par2 >= field_94407_b.length)
    033        {
    034            par2 = 0;
    035        }
    036
    037        return this.field_94408_c[par2];
    038    }
    039
    040    /**
    041     * Determines the damage on the item the block drops. Used in cloth and wood.
    042     */
    043    public int damageDropped(int par1)
    044    {
    045        return par1;
    046    }
    047
    048    @SideOnly(Side.CLIENT)
    049
    050    /**
    051     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
    052     */
    053    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
    054    {
    055        for (int j = 0; j < 4; ++j)
    056        {
    057            par3List.add(new ItemStack(par1, 1, j));
    058        }
    059    }
    060
    061    @SideOnly(Side.CLIENT)
    062
    063    /**
    064     * When this method is called, your block should register all the icons it needs with the given IconRegister. This
    065     * is the only chance you get to register icons.
    066     */
    067    public void registerIcons(IconRegister par1IconRegister)
    068    {
    069        this.field_94408_c = new Icon[field_94407_b.length];
    070
    071        for (int i = 0; i < this.field_94408_c.length; ++i)
    072        {
    073            this.field_94408_c[i] = par1IconRegister.registerIcon(field_94407_b[i]);
    074        }
    075    }
    076}