if(!plantable.canBePlantedHere(worldObj, bp.x, bp.y, bp.z, availableStack))
{
continue;
}
plantable.prePlant(worldObj, bp.x, bp.y, bp.z, availableStack);
worldObj.setBlock(bp.x, bp.y, bp.z,
plantable.getPlantedBlockId(worldObj, bp.x, bp.y, bp.z, availableStack),
plantable.getPlantedBlockMetadata(worldObj, bp.x, bp.y, bp.z, availableStack), 3);
plantable.postPlant(worldObj, bp.x, bp.y, bp.z, availableStack);
decrStackSize(stackIndex, 1);