diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index 04b90fa..e4e6c29 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -182,14 +182,9 @@ public class SWCommandUtils { } private static Function> numberCompleter(Function mapper) { - return s -> { - try { - mapper.apply(s); - return Collections.singletonList(s); - } catch (Exception e) { - return Collections.emptyList(); - } - }; + return s -> numberMapper(mapper).apply(s) != null + ? Collections.singletonList(s) + : Collections.emptyList(); } static T[] getAnnotation(Method method, Class annotation) { diff --git a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java index d53b4a6..15dad9a 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java @@ -40,7 +40,7 @@ class SubCommand { private Function commandSenderFunction; Class varArgType = null; - public SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map> localTypeMapper) { + SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map> localTypeMapper) { this.swCommand = swCommand; this.method = method;