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