(It's supposed to delete an entity and replace it with a similar entity in the same location with a unique marketplace data)
Spoiler
// Replacing Drakon with Ravaryea analogue
LocationAPI hyper = Global.getSector().getHyperspace();
String amazing = "mamamia"; // 11000, -7500(Naraka), -4400,-4500(Askonia) +- 200
for (SectorEntityToken e : hyper.getAllEntities()) {
if (e.getLocation().x > -4200 && e.getLocation().x < -4600 && e.getLocation().y > -4300 && e.getLocation().y < -4700) {
amazing = e.getId();
}
}
Global.getSector().getHyperspace().removeEntity(Global.getSector().getEntityById(amazing));
system.removeEntity(Global.getSector().getEntityById("drakon"));
PlanetAPI drakon = system.addPlanet("drakon_fortress", system.getStar(), "Drakon", "terran-eccentric", 280, 150, 12000, 1000); //formerly 450 and 650
if (!isPAGSM) {
drakon.setCustomDescriptionId("planet_drakon_fortress");
} else {
drakon.setCustomDescriptionId("planet_drakon_fortress_PAGSM");
}
MarketAPI drakon_fortress_market = addMarketplace(
"sindrian_diktat",
drakon,
null,
"Drakon",
5,
new ArrayList<>(
Arrays.asList(
Conditions.POPULATION_5,
Conditions.HABITABLE,
Conditions.VERY_COLD,
Conditions.DARK,
Conditions.FARMLAND_ADEQUATE,
Conditions.ORGANICS_PLENTIFUL,
Conditions.VOLATILES_DIFFUSE,
Conditions.OUTPOST
)
),
new ArrayList<>(
Arrays.asList(
Submarkets.SUBMARKET_OPEN,
Submarkets.SUBMARKET_STORAGE,
Submarkets.SUBMARKET_BLACK
)
),
new ArrayList<>(
Arrays.asList(
Industries.POPULATION,
Industries.SPACEPORT,
Industries.PATROLHQ,
Industries.MINING,
Industries.FARMING,
"commerce",
Industries.ORBITALSTATION,
Industries.GROUNDDEFENSES
)
),
//tariffs
0.18f,
//freeport
false,
//junk and chatter
true);
drakon.setMarket(drakon_fortress_market);
drakon.getMarket().getIndustry(Industries.POPULATION).setSpecialItem(new SpecialItemData(Items.ORBITAL_FUSION_LAMP, null));
Misc.setAllPlanetsKnown(system);
The market seems to spawn deformed; it fails to spawn conditions properly(no effect on hazard, or fail to show up on market screen) and has no admins or people on its comms boards. Does anyone know what's up?