This commit is contained in:
SolarisDev 2023-01-19 13:33:39 +01:00
parent 80d8867eb0
commit 40b110f835
2 changed files with 2 additions and 1 deletions

View File

@ -354,7 +354,7 @@ public class WarpSignsManager {
//By checking if the teleport succeeded before sending the messages,
//we prevent issues where no one teleported, but people still
//get messages about it.
Util.teleportAsync(user.getPlayer(), actualWarp, TeleportCause.COMMAND).whenComplete((tpResult, ignored) -> {
Util.teleportAsync(user.getPlayer(), actualWarp, TeleportCause.COMMAND).thenAccept(tpResult -> {
if(!tpResult) return;
User warpOwner = Objects.requireNonNull(User.getInstance(signOwner));

View File

@ -428,6 +428,7 @@ public class WarpSignsManagerTest {
when(p.getLocation()).thenReturn(location);
@Nullable
User u = User.getInstance(p);
PowerMockito.when(Util.teleportAsync(any(), any(), any())).thenReturn(CompletableFuture.completedFuture(true));
wsm.warpPlayer(world, u, uuid);
PowerMockito.verifyStatic(Util.class);
Util.teleportAsync(eq(p), any(), eq(TeleportCause.COMMAND));