This commit is contained in:
Anthony Calosa
2023-04-01 15:31:51 +08:00
parent b9b751f3ef
commit b665c42b33
2 changed files with 4 additions and 5 deletions

View File

@@ -213,8 +213,8 @@ public class ConsoleCommandInterpreter {
for (PointOfInterestData poi : data.getPointsOfInterest())
poiNames.add(poi.name + " - " + poi.type);
}
String poi = "POI Names - Types\n" + String.join("\n", poiNames);
return poi;
System.out.println("POI Names - Types\n" + String.join("\n", poiNames));
return "POI lists dumped to stdout.";
});
registerCommand(new String[]{"setColorID"}, s -> {
if (s.length < 1)

View File

@@ -452,7 +452,7 @@ public class World implements Disposable, SaveFileContent {
biomeIndex2++;
for (PointOfInterestData poi : biome.getPointsOfInterest()) {
for (int i = 0; i < poi.count; i++) {
for (int counter = 0; counter < 1000; counter++)//tries 1000 times to find a free point
for (int counter = 0; counter < 500; counter++)//tries 500 times to find a free point
{
float radius = (float) Math.sqrt(((random.nextDouble()) / 2 * poi.radiusFactor));
float theta = (float) (random.nextDouble() * 2 * Math.PI);
@@ -502,7 +502,7 @@ public class World implements Disposable, SaveFileContent {
}
}
if (!foundSolution) {
if (counter == 999) {
if (counter == 499) {
System.err.print("Can not place POI " + poi.name + "...Rerunning..\n");
running = true;
}
@@ -533,7 +533,6 @@ public class World implements Disposable, SaveFileContent {
}
break;
}
}
}
}