fix teleport after world creation

This commit is contained in:
Julian Krings 2025-08-02 23:15:57 +02:00
parent dc8cf0ad38
commit aaf2f2f8a6
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2

View File

@ -183,7 +183,15 @@ public class IrisCreator {
}
if (sender.isPlayer() && !benchmark) {
J.s(() -> Iris.platform.teleportAsync(sender.player(), new Location(world, 0, world.getHighestBlockYAt(0, 0), 0)));
Iris.platform.getRegionScheduler()
.run(world, 0, 0, () -> world.getHighestBlockYAt(0, 0) + 1)
.getResult()
.thenAccept(y -> Iris.platform.teleportAsync(sender.player(), new Location(world, 0, y, 0)))
.exceptionally(err -> {
sender.sendMessage(C.RED + "Failed to teleport you to the world!");
err.printStackTrace();
return null;
});
}
if (studio || benchmark) {