Only accept posted console option picking when valid result

This commit is contained in:
CocoTheOwner 2021-09-27 15:26:40 +02:00
parent 734c0a37f7
commit 85fe65612e

View File

@ -546,7 +546,8 @@ public class VirtualDecreeCommand {
CompletableFuture<String> future = new CompletableFuture<>(); CompletableFuture<String> future = new CompletableFuture<>();
Iris.service(CommandSVC.class).postConsole(future); Iris.service(CommandSVC.class).postConsole(future);
try { try {
return future.get(15, TimeUnit.SECONDS); String result = future.get(15, TimeUnit.SECONDS);
return validOptions.convert(handler::toStringForce).contains(result) ? result : null;
} catch (InterruptedException | ExecutionException | TimeoutException ignored) { } catch (InterruptedException | ExecutionException | TimeoutException ignored) {
} }