Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean> 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:
Expand All @@ -40,7 +46,7 @@ public void run(final Server server, final User user, final String commandLabel,
}

final CompletableFuture<Boolean> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}