Reduce future join call usage

This commit is contained in:
William committed 2022-09-24 22:00:48 +01:00
1 parent 8a4ed7c565
commit 649d4c0600
18 files changed
+316 -291

No files matched your search

@@ -68,9 +68,9 @@ public class DelWarpCommand extends CommandBase implements TabCompletable {
for (final Warp toDelete : warps) {
homeDeletionFuture.add(plugin.getSavedPositionManager().deleteWarp(toDelete.meta.name));
}
CompletableFuture.allOf(homeDeletionFuture.toArray(new CompletableFuture[0])).thenRunAsync(() ->
plugin.getLocales().getLocale("delete_all_warps_success", Integer.toString(homeDeletionFuture.size()))
.ifPresent(deleter::sendMessage)).join();
CompletableFuture.allOf(homeDeletionFuture.toArray(new CompletableFuture[0]))
.thenRun(() -> plugin.getLocales().getLocale("delete_all_warps_success",
Integer.toString(homeDeletionFuture.size())).ifPresent(deleter::sendMessage));
});
}