CommandFramework3 #94
@ -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();
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Ich denke mal, das throw new SecurityException aus der Zeile drüber wäre auch angebracht. Auf jeden Fall für "RuntimeException".