001    package net.minecraft.src;
002    
003    import cpw.mods.fml.common.Side;
004    import cpw.mods.fml.common.asm.SideOnly;
005    import java.util.List;
006    
007    public class BlockWood extends Block
008    {
009        /** The type of tree this block came from. */
010        public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"};
011    
012        public BlockWood(int par1)
013        {
014            super(par1, 4, Material.wood);
015            this.setCreativeTab(CreativeTabs.tabBlock);
016        }
017    
018        /**
019         * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
020         */
021        public int getBlockTextureFromSideAndMetadata(int par1, int par2)
022        {
023            switch (par2)
024            {
025                case 1:
026                    return 198;
027                case 2:
028                    return 214;
029                case 3:
030                    return 199;
031                default:
032                    return 4;
033            }
034        }
035    
036        /**
037         * Determines the damage on the item the block drops. Used in cloth and wood.
038         */
039        protected int damageDropped(int par1)
040        {
041            return par1;
042        }
043    
044        @SideOnly(Side.CLIENT)
045    
046        /**
047         * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
048         */
049        public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
050        {
051            par3List.add(new ItemStack(par1, 1, 0));
052            par3List.add(new ItemStack(par1, 1, 1));
053            par3List.add(new ItemStack(par1, 1, 2));
054            par3List.add(new ItemStack(par1, 1, 3));
055        }
056    }