mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Made //help sort // commands ignoring prefixed slashes.
This commit is contained in:
parent
caeab76abb
commit
af6455ea6b
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.commands;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
@ -445,10 +446,19 @@ public class UtilityCommands {
|
||||
final CommandsManager<LocalPlayer> commandsManager = we.getCommandsManager();
|
||||
|
||||
if (args.argsLength() == 0) {
|
||||
SortedSet<String> commands = new TreeSet<String>(new Comparator<String>() {
|
||||
public int compare(String o1, String o2) {
|
||||
final int ret = o1.replaceAll("/", "").compareToIgnoreCase(o2.replaceAll("/", ""));
|
||||
if (ret == 0) {
|
||||
return o1.compareToIgnoreCase(o2);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
});
|
||||
commands.addAll(commandsManager.getCommands().keySet());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean first = true;
|
||||
SortedSet<String> commands = new TreeSet<String>(commandsManager.getCommands().keySet());
|
||||
|
||||
for (String command : commands) {
|
||||
if (!first) {
|
||||
sb.append(", ");
|
||||
|
Loading…
Reference in New Issue
Block a user