mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Sort flag list alphabetically
This commit is contained in:
parent
37b0cdeace
commit
6ed6f607b5
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user