From aaf2f2f8a6c9853deb73d989b27db25d58dbb721 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Sat, 2 Aug 2025 23:15:57 +0200 Subject: [PATCH] fix teleport after world creation --- .../java/com/volmit/iris/core/tools/IrisCreator.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/volmit/iris/core/tools/IrisCreator.java b/core/src/main/java/com/volmit/iris/core/tools/IrisCreator.java index c7d877d8d..935ef01be 100644 --- a/core/src/main/java/com/volmit/iris/core/tools/IrisCreator.java +++ b/core/src/main/java/com/volmit/iris/core/tools/IrisCreator.java @@ -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) {