mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-04-06 13:30:43 +08:00
Fix spawn command sending message before teleportation (#6025)
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
parent
e3e247dd61
commit
263dab54d0
@ -71,7 +71,6 @@ public class Commandspawn extends EssentialsCommand {
|
||||
if (spawn == null) {
|
||||
return;
|
||||
}
|
||||
sender.sendTl("teleporting", spawn.getWorld().getName(), spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ());
|
||||
future.exceptionally(e -> {
|
||||
showError(sender.getSender(), e, commandLabel);
|
||||
return false;
|
||||
@ -83,8 +82,14 @@ public class Commandspawn extends EssentialsCommand {
|
||||
}
|
||||
if (teleportOwner == null) {
|
||||
teleportee.getAsyncTeleport().now(spawn, false, TeleportCause.COMMAND, future);
|
||||
return;
|
||||
} else {
|
||||
teleportOwner.getAsyncTeleport().teleportPlayer(teleportee, spawn, charge, TeleportCause.COMMAND, future);
|
||||
}
|
||||
teleportOwner.getAsyncTeleport().teleportPlayer(teleportee, spawn, charge, TeleportCause.COMMAND, future);
|
||||
future.thenAccept(success -> {
|
||||
if (success) {
|
||||
sender.sendTl("teleporting", spawn.getWorld().getName(), spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user