In an hourlong speech before the U.N. General Assembly, Trump attacked European allies, renewable energy and his predecessor.