So, I'm pretty sure that invasion events (Goblin Army, Pirate Invasion, Pumpkin and Frost Moons) should be overriding all spawns when on the surface, but for some reason, space enemies can still spawn during one of these invasions, which seems pretty off. Who knows, but it's definitely annoying...