diff --git a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java index 747e602..640bdbf 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java @@ -19,6 +19,7 @@ package de.steamwar.command; +import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import java.lang.reflect.InvocationTargetException; @@ -26,6 +27,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Parameter; import java.util.*; import java.util.function.Function; +import java.util.logging.Level; class SubCommand { @@ -95,6 +97,7 @@ class SubCommand { } catch (IllegalArgumentException | IllegalAccessException e) { throw new SecurityException(e.getMessage(), e); } catch (InvocationTargetException | RuntimeException e) { + Bukkit.getLogger().log(Level.INFO, e.getMessage(), e); return false; } return true; @@ -126,7 +129,9 @@ class SubCommand { String s = argsList.remove(0); if (argsList.isEmpty()) return arguments[arguments.length - 1].tabCompletes(commandSender, Arrays.copyOf(args, args.length - 1), s); try { - arguments[arguments.length - 1].map(s); + if (arguments[arguments.length - 1].map(s) == null) { + return Collections.emptyList(); + } } catch (Exception e) { return Collections.emptyList(); }