From fd49b70a6976632f71c33bccd4bebc1bf7b69988 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Thu, 13 Apr 2023 02:22:47 -0400 Subject: [PATCH] Fix top command not sending messages (#5302) my three year old refactors still haunt me --- .../java/com/earth2me/essentials/commands/Commandtop.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtop.java index f39b12789..705828500 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtop.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtop.java @@ -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 future = new CompletableFuture<>(); + final CompletableFuture 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); } }