Fix SWCommand help list sorting
Dieser Commit ist enthalten in:
Ursprung
9db16383e4
Commit
78985f15de
@ -125,7 +125,15 @@ public abstract class SWCommand {
|
|||||||
o2.varArgType != null ? Integer.MAX_VALUE : o2.arguments.length);
|
o2.varArgType != null ? Integer.MAX_VALUE : o2.arguments.length);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
commandHelpList.sort(Comparator.comparingInt(o -> -o.subCommand.length));
|
commandHelpList.sort((o1, o2) -> {
|
||||||
|
int compare = Integer.compare(-o1.subCommand.length, -o2.subCommand.length);
|
||||||
|
if (compare != 0) {
|
||||||
|
return compare;
|
||||||
|
} else {
|
||||||
|
return Integer.compare(o1.method.getDeclaringClass() == SWCommand.class ? 0 : 1,
|
||||||
|
o2.method.getDeclaringClass() == SWCommand.class ? 0 : 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import static de.steamwar.command.SWCommandUtils.*;
|
|||||||
class SubCommand {
|
class SubCommand {
|
||||||
|
|
||||||
private SWCommand swCommand;
|
private SWCommand swCommand;
|
||||||
private Method method;
|
Method method;
|
||||||
String description;
|
String description;
|
||||||
Parameter[] parameters;
|
Parameter[] parameters;
|
||||||
String[] subCommand;
|
String[] subCommand;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren