mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-11 22:29:46 +01:00
Fix top command not sending messages (#5302)
my three year old refactors still haunt me
This commit is contained in:
parent
3a737480ec
commit
fd49b70a69
@ -24,12 +24,12 @@ public class Commandtop extends EssentialsCommand {
|
||||
final float yaw = user.getLocation().getYaw();
|
||||
final Location unsafe = new Location(user.getWorld(), topX, ess.getWorldInfoProvider().getMaxHeight(user.getWorld()), topZ, yaw, pitch);
|
||||
final Location safe = LocationUtil.getSafeDestination(ess, unsafe);
|
||||
final CompletableFuture<Boolean> future = new CompletableFuture<>();
|
||||
final CompletableFuture<Boolean> future = getNewExceptionFuture(user.getSource(), commandLabel);
|
||||
future.thenAccept(success -> {
|
||||
if (success) {
|
||||
user.sendMessage(tl("teleportTop", safe.getWorld().getName(), safe.getBlockX(), safe.getBlockY(), safe.getBlockZ()));
|
||||
}
|
||||
});
|
||||
user.getAsyncTeleport().teleport(safe, new Trade(this.getName(), ess), TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel));
|
||||
user.getAsyncTeleport().teleport(safe, new Trade(this.getName(), ess), TeleportCause.COMMAND, future);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user