Pickaxe + Tall Grass = Dead Bush?

Discussion in 'Plugin Development' started by zwarmapapa, Feb 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    zwarmapapa

    When my plugin breaks a Tall Grass with a pickaxe, I get a Dead Bush?

    Code:
    public void drillBlock( Block blockToBeDrilled, Block chestBlock )
    {
        if( blockToBeDrilled.getTypeId() > 0 )
        {
            if( chestBlock.getTypeId() == BlockID.CHEST )
            {
                Chest chest = (Chest) chestBlock.getState();
                
                final int DIAMOND_PICKAXE = 278;
                Collection<ItemStack> drops = blockToBeDrilled.getDrops( new ItemStack(DIAMOND_PICKAXE, 1) );
                clearBlock( blockToBeDrilled );
                
                for( ItemStack drop : drops )
                {
                    HashMap<Integer,ItemStack> cantFitItems = chest.getInventory().addItem( drop );
                    
                    for( Entry<Integer,ItemStack> cantFitItem : cantFitItems.entrySet() )
                    {
                        chestBlock.getWorld().dropItemNaturally( chestBlock.getLocation(), cantFitItem.getValue() );
                    }
                }
            }
        }
    }
    If blockToBeDrilled is tall grass, a dead bush will go into my chest?
    Why?

    PS: destroying tall grass (with the client) with a diamond pickaxe gives me nothing, no dead bush.

    Edit: Hmm... now, when I mine stone, it won't give cobblestone, but it will give normal stone? This didn't happen a couple days ago, anyone knows why this could happen?

    Ok, I did some tests, and it turned out SpoutPlugin caused it? WTF?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
Thread Status:
Not open for further replies.

Share This Page