SteamWar/SpigotCore
Archiviert
13
0

Sort SWCommand.commandSet by subCommand length

Sort SWCommand.commandHelpSet by subCommand length
Dieser Commit ist enthalten in:
yoyosource 2021-03-30 12:03:48 +02:00
Ursprung e7beaa2b0f
Commit a1651e896f
2 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -131,6 +131,9 @@ public abstract class SWCommand {
} }
commandSet.add(new SubCommand(this, method, anno.value())); commandSet.add(new SubCommand(this, method, anno.value()));
}); });
commandSet.sort(Comparator.comparingInt(o -> -o.subCommand.length));
commandHelpSet.sort(Comparator.comparingInt(o -> -o.subCommand.length));
} }
} }

Datei anzeigen

@ -19,7 +19,6 @@
package de.steamwar.command; package de.steamwar.command;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -27,13 +26,12 @@ import java.lang.reflect.Method;
import java.lang.reflect.Parameter; import java.lang.reflect.Parameter;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.logging.Level;
class SubCommand { class SubCommand {
private SWCommand swCommand; private SWCommand swCommand;
private Method method; private Method method;
private String[] subCommand; String[] subCommand;
private TypeMapper<?>[] arguments; private TypeMapper<?>[] arguments;
private boolean varArgs = false; private boolean varArgs = false;
private Function<CommandSender, ?> commandSenderFunction; private Function<CommandSender, ?> commandSenderFunction;