Make the /tpahere and /tpa request sent confirmation message accurately report who the request was sent to

This commit is contained in:
William committed 2022-08-29 23:30:33 +01:00
1 parent c0b6b45617
commit f32082a8bf
5 files changed
+33 -25

No files matched your search

@@ -39,7 +39,7 @@ public class TpaAllCommand extends CommandBase {
final List<CompletableFuture<Void>> sentRequestsFuture = new ArrayList<>();
players.forEach(playerName -> sentRequestsFuture.add(plugin.getRequestManager()
.sendTeleportRequest(onlineUser, playerName, TeleportRequest.RequestType.TPA_HERE)
.thenAccept(sent -> counter.addAndGet(sent ? 1 : 0))));
.thenAccept(sent -> counter.addAndGet(sent.isPresent() ? 1 : 0))));
// Send a message when all requests have been sent
CompletableFuture.allOf(sentRequestsFuture.toArray(new CompletableFuture[0])).thenRun(() -> {