diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpo.java index 8ff98843485..5da4a83437f 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpo.java @@ -25,7 +25,13 @@ public void run(final Server server, final User user, final String commandLabel, if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) { throw new TranslatableException("noPerm", "essentials.worlds." + player.getWorld().getName()); } - user.getAsyncTeleport().now(player.getBase(), false, TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel)); + final CompletableFuture selfFuture = getNewExceptionFuture(user.getSource(), commandLabel); + user.getAsyncTeleport().nowUnsafe(player.getBase().getLocation(), TeleportCause.COMMAND, selfFuture); + selfFuture.thenAccept(success -> { + if (success) { + user.sendTl("teleporting", player.getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()); + } + }); break; default: @@ -40,7 +46,7 @@ public void run(final Server server, final User user, final String commandLabel, } final CompletableFuture future = getNewExceptionFuture(user.getSource(), commandLabel); - target.getAsyncTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND, future); + target.getAsyncTeleport().nowUnsafe(toPlayer.getBase().getLocation(), TeleportCause.COMMAND, future); future.thenAccept(success -> { if (success) { target.sendTl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()); diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpoffline.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpoffline.java index cc4f31c0e32..ce7d5fe721e 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpoffline.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtpoffline.java @@ -30,8 +30,7 @@ public void run(final Server server, final User user, final String label, final } user.sendTl("teleporting", logout.getWorld().getName(), logout.getBlockX(), logout.getBlockY(), logout.getBlockZ()); - user.getAsyncTeleport().now(logout, false, PlayerTeleportEvent.TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), label)); + user.getAsyncTeleport().nowUnsafe(logout, PlayerTeleportEvent.TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), label)); } } } -