16 StarSystemAPI system = context.system;
17 SectorEntityToken parent = context.center;
18 if (context.parent !=
null) parent = context.parent;
42 if (maxPlanets > 1) maxPlanets = 1;
45 float orbitRadius = context.currentRadius + width / 2f;
50 count = (int) (100f + (count - 100f) * 0.25f);
52 if (count > 250) count = 250;
54 SectorEntityToken belt = system.addAsteroidBelt(parent, count, orbitRadius, width, orbitDays * .75f, orbitDays * 1.5f, Terrain.ASTEROID_BELT,
null);
62 system.addRingBand(parent,
"misc",
"rings_asteroids0", 256f, indexPicker.pickAndRemove(), Color.white, 256f, orbitRadius - width * 0.25f, orbitDays * 1.05f,
null,
null);
70 system.addRingBand(parent,
"misc",
"rings_asteroids0", 256f, indexPicker.pickAndRemove(), Color.white, 256f, orbitRadius + width * 0.25f, orbitDays,
null,
null);
73 float prevRadius = context.currentRadius;
76 for (
int i = 0; i < maxPlanets; i++) {
79 WeightedRandomPicker<EntityGenDataSpec> picker = context.gen.getPickerForCategory(cat, context,
82 picker.print(
" Picking from category " + cat.
getCategory() +
83 ", orbit index " + (context.parent !=
null ? context.parentOrbitIndex : context.orbitIndex));
88 System.out.println(
" Nothing to pick");
91 System.out.println(
" Picked: " + pick.
getId());
100 context.currentRadius = prevRadius - width * 0.6f;
102 context.parentRadiusOverride = 200f;
103 GenResult result = context.gen.addPlanet(context, planetData,
true,
false);
104 if (result !=
null && !result.entities.isEmpty()) {
105 context.gen.getAllEntitiesAdded().put(result.entities.get(0), result.entities);
108 if (!context.generatedPlanets.isEmpty()) {
109 GeneratedPlanet last = context.generatedPlanets.get(context.generatedPlanets.size() - 1);
110 last.planet.setRadius(last.planet.getRadius() * 0.75f);
115 context.parentRadiusOverride = -1;
116 context.currentRadius = prevRadius;
119 GenResult result =
new GenResult();
120 result.onlyIncrementByWidth =
false;
121 result.orbitalWidth = width;
122 result.entities.add(belt);