HARRISBURG (AP) — Pennsylvania’s state Senate is advancing legislation that would bar municipalities in the nation’s No. 2 natural gas state from adopting building codes that prohibit gas hookups, or otherwise restricting utility service based on the energy source. The Republican-penned bill passed on Wednesday, 35-15, and heads to the state House of Representatives. Six Democrats joined all 29 Republicans in favor of it. The bill defends a homegrown energy source in Pennsylvania as some states, cities and counties elsewhere begin looking at all-electric building codes that exclude gas infrastructure as a way to fight climate change and accelerate progress towards a carbon-free electricity grid.