From 580408b92a214384e3764a8fc848775c149f2fef Mon Sep 17 00:00:00 2001 From: comp500 Date: Fri, 30 Aug 2019 14:52:06 +0100 Subject: [PATCH] Accept optional mods on the server rather than throwing an exception --- .../link/infra/packwiz/installer/ui/CLIHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/link/infra/packwiz/installer/ui/CLIHandler.java b/src/main/java/link/infra/packwiz/installer/ui/CLIHandler.java index 71bcbd0..e9973cd 100644 --- a/src/main/java/link/infra/packwiz/installer/ui/CLIHandler.java +++ b/src/main/java/link/infra/packwiz/installer/ui/CLIHandler.java @@ -35,8 +35,14 @@ public class CLIHandler implements IUserInterface { } @Override - public Future showOptions(List option) { - throw new RuntimeException("Optional mods not implemented for CLI! Make sure your optional mods are only on the client side!"); + public Future showOptions(List options) { + for (IOptionDetails opt : options) { + opt.setOptionValue(true); + System.out.println("Warning: accepting option " + opt.getName() + " as option choosing is not implemented in the CLI"); + } + CompletableFuture future = new CompletableFuture<>(); + future.complete(false); // Can't be cancelled! + return future; } @Override