A new £30m investment has been announced by the government to help make sea travel more environmentally friendly.