The state would pledge to eliminate net greenhouse gas emissions by 2050, with all its electricity coming from carbon-free sources. New York lawmakers have agreed to pass a sweeping climate plan…