Merge pull request #685 from CocoTheOwner/printPregenDet

Print pregen details
This commit is contained in:
Dan 2021-11-11 17:52:29 -05:00 committed by GitHub
commit a008a425ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,15 +47,18 @@ public class CommandPregen implements DecreeExecutor {
sender().sendMessage(C.RED + "Please make sure the world is loaded & the engine is initialized. Generate a new chunk, for example."); sender().sendMessage(C.RED + "Please make sure the world is loaded & the engine is initialized. Generate a new chunk, for example.");
} }
radius = Math.max(radius, 1024); radius = Math.max(radius, 1024);
int w = (radius >> 9 + 1) * 2;
IrisToolbelt.pregenerate(PregenTask IrisToolbelt.pregenerate(PregenTask
.builder() .builder()
.center(new Position2(center)) .center(new Position2(center))
.width((radius >> 9 + 1) * 2) .width(w)
.height((radius >> 9 + 1) * 2) .height(w)
.build(), world); .build(), world);
sender().sendMessage(C.GREEN + "Successfully started the pregeneration task!"); String msg = C.GREEN + "Pregen started in " + C.GOLD + world.getName() + C.GREEN + " of " + C.GOLD + w + C.GREEN + " by " + C.GOLD + w + C.GREEN + " blocks from " + C.GOLD + center.getX() + "," + center.getZ();
sender().sendMessage(msg);
Iris.info(msg);
} catch (Throwable e) { } catch (Throwable e) {
sender().sendMessage(C.RED + "Epic fail"); sender().sendMessage(C.RED + "Epic fail. See console.");
Iris.reportError(e); Iris.reportError(e);
e.printStackTrace(); e.printStackTrace();
} }