Various fixes for /tp

This commit is contained in:
William committed 2022-08-18 16:44:49 +01:00
1 parent cf6d9a6079
commit 9332371c71
3 files changed
+35 -8

No files matched your search

@@ -156,14 +156,14 @@ public class TeleportManager {
if (currentlyOnWarmup.contains(onlineUser.uuid)) {
return CompletableFuture.supplyAsync(() -> TeleportResult.FAILED_ALREADY_TELEPORTING);
}
return processTeleportWarmup(new TimedTeleport(onlineUser, position, teleportWarmupTime))
return CompletableFuture.supplyAsync(() -> processTeleportWarmup(new TimedTeleport(onlineUser, position, teleportWarmupTime))
.thenApply(teleport -> {
if (!teleport.cancelled) {
return teleportNow(onlineUser, position);
return teleportNow(onlineUser, position).join();
} else {
return CompletableFuture.supplyAsync(() -> TeleportResult.CANCELLED);
return TeleportResult.CANCELLED;
}
}).join();
}).join());
} else {
return teleportNow(onlineUser, position);
}