Sort SWCommand.commandSet by subCommand length
Sort SWCommand.commandHelpSet by subCommand length
Dieser Commit ist enthalten in:
Ursprung
e7beaa2b0f
Commit
a1651e896f
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren