Legislature passes ban on sugary drinks