    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 BlockWood extends Block
    013{
    014    /** The type of tree this block came from. */
    015    public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"};
    016    public static final String[] field_94386_b = new String[] {"wood", "wood_spruce", "wood_birch", "wood_jungle"};
    017    @SideOnly(Side.CLIENT)
    018    private Icon[] field_94387_c;
    019
    020    public BlockWood(int par1)
    021    {
    022        super(par1, Material.wood);
    023        this.setCreativeTab(CreativeTabs.tabBlock);
    024    }
    025
    026    @SideOnly(Side.CLIENT)
    027
    028    /**
    029     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
    030     */
    031    public Icon getBlockTextureFromSideAndMetadata(int par1, int par2)
    032    {
    033        if (par2 < 0 || par2 >= this.field_94387_c.length)
    034        {
    035            par2 = 0;
    036        }
    037
    038        return this.field_94387_c[par2];
    039    }
    040
    041    /**
    042     * Determines the damage on the item the block drops. Used in cloth and wood.
    043     */
    044    public int damageDropped(int par1)
    045    {
    046        return par1;
    047    }
    048
    049    @SideOnly(Side.CLIENT)
    050
    051    /**
    052     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
    053     */
    054    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
    055    {
    056        par3List.add(new ItemStack(par1, 1, 0));
    057        par3List.add(new ItemStack(par1, 1, 1));
    058        par3List.add(new ItemStack(par1, 1, 2));
    059        par3List.add(new ItemStack(par1, 1, 3));
    060    }
    061
    062    @SideOnly(Side.CLIENT)
    063    public void func_94332_a(IconRegister par1IconRegister)
    064    {
    065        this.field_94387_c = new Icon[field_94386_b.length];
    066
    067        for (int i = 0; i < this.field_94387_c.length; ++i)
    068        {
    069            this.field_94387_c[i] = par1IconRegister.func_94245_a(field_94386_b[i]);
    070        }
    071    }
    072}