    001    package net.minecraft.src;
    002
    003    import java.util.Random;
    004
    005    public class BlockDeadBush extends BlockFlower
    006    {
    007        protected BlockDeadBush(int par1, int par2)
    008        {
    009            super(par1, par2, Material.vine);
    010            float var3 = 0.4F;
    011            this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.8F, 0.5F + var3);
    012        }
    013
    014        /**
    015         * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
    016         * blockID passed in. Args: blockID
    017         */
    018        protected boolean canThisPlantGrowOnThisBlockID(int par1)
    019        {
    020            return par1 == Block.sand.blockID;
    021        }
    022
    023        /**
    024         * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
    025         */
    026        public int getBlockTextureFromSideAndMetadata(int par1, int par2)
    027        {
    028            return this.blockIndexInTexture;
    029        }
    030
    031        /**
    032         * Returns the ID of the items to drop on destruction.
    033         */
    034        public int idDropped(int par1, Random par2Random, int par3)
    035        {
    036            return -1;
    037        }
    038
    039        /**
    040         * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the
    041         * block and l is the block's subtype/damage.
    042         */
    043        public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
    044        {
    045            if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
    046            {
    047                par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
    048                this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.deadBush, 1, par6));
    049            }
    050            else
    051            {
    052                super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
    053            }
    054        }
    055    }