Sort flag list alphabetically

This commit is contained in:
Jesse Boyd 2018-06-13 09:28:32 +10:00
parent 37b0cdeace
commit 6ed6f607b5
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 7 additions and 8 deletions

View File

@ -151,7 +151,7 @@ public class DebugExec extends SubCommand {
@Override
public boolean onCommand(final PlotPlayer player, String[] args) {
List<String> allowed_params =
Arrays.asList("calibrate-analysis", "remove-flag", "stop-expire", "start-expire", "seen", "list-scripts");
Arrays.asList("analyze", "calibrate-analysis", "remove-flag", "stop-expire", "start-expire", "seen", "list-scripts", "start-rgar", "stop-rgar", "help", "addcmd", "runasync", "run", "allcmd", "all");
if (args.length > 0) {
String arg = args[0].toLowerCase();
String script;

View File

@ -15,11 +15,7 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.*;
import com.plotsquared.general.commands.CommandDeclaration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
@CommandDeclaration(
command = "setflag",
@ -250,8 +246,11 @@ public class FlagCmd extends SubCommand {
}
String message = "";
String prefix = "";
for (Map.Entry<String, ArrayList<String>> stringArrayListEntry : flags.entrySet()) {
message += prefix + "&6" + stringArrayListEntry.getKey() + ": &7" + StringMan.join(stringArrayListEntry.getValue(), ", ");
for (Map.Entry<String, ArrayList<String>> entry : flags.entrySet()) {
String category = entry.getKey();
List<String> flagNames = entry.getValue();
Collections.sort(flagNames);
message += prefix + "&6" + category + ": &7" + StringMan.join(flagNames, ", ");
prefix = "\n";
}
MainUtil.sendMessage(player, message);