Thanks! Hmm.
I subclassed StarSystemGenerator, duplicated the static addOrbitingEntities(), and replaced:
gen.pickNebulaAndBackground();
with:
gen.systemType = system.getType();
if (system.getType().equals(StarSystemType.NEBULA)) {
if (age.equals(StarAge.YOUNG)) gen.nebulaType = NEBULA_BLUE;
else if (age.equals(StarAge.OLD)) gen.nebulaType = NEBULA_AMBER;
else gen.nebulaType = NEBULA_DEFAULT;
} else {
gen.nebulaType = NEBULA_NONE;
}
It seems to work perfectly with this modification.
This looks like it'll work for your case, but it's not quite correct - it's conflating whether a star system is a nebula (i.e. has no star, and stuff doesn't circle the center) with whether the constellation is inside a nebula (i.e. it has a nebula background in the map, and more nebula-clouds in the system map). The first implies the second, but the second does not imply the first.
I *think* just having:
gen.pickNebulaAndBackground();
if (system.getType() != null) gen.systemType = system.getType();
Would do the job. Probably. Might be missing some corner case here, though.
Ran into a problem with gas giant gravity well names because of this code in StarSystemGenerator.addPlanet():
if (planet.isGasGiant()) {
if (systemType == StarSystemType.NEBULA) {
planet.setAutogenJumpPointNameInHyper(system.getBaseName() + ", " + planetName + " Gravity Well");
}
}
It gives results like "Kiska, Planet 5 Gravity Well". Proc-gen nebula systems show normal gas giant JP names, so I suspect this is debug code that can be safely commented out.
I didn't try that, though, just fixed the borked names later.
Ah, I don't think the quoted code actually matters - that is, the field is sets looks like it only gets checked for jump-points, not planets. Not sure why it's there in the first place, though - probably, as you say, some leftover debug stuff.