SteamWar/SpigotCore
Archiviert
13
0

Fix SubCommand varAgrs tabComplete

Dieser Commit ist enthalten in:
yoyosource 2021-03-30 08:36:06 +02:00
Ursprung db8d9697e6
Commit 1d1d95b78f

Datei anzeigen

@ -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();
}