mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +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
|
@Override
|
||||||
public boolean onCommand(final PlotPlayer player, String[] args) {
|
public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||||
List<String> allowed_params =
|
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) {
|
if (args.length > 0) {
|
||||||
String arg = args[0].toLowerCase();
|
String arg = args[0].toLowerCase();
|
||||||
String script;
|
String script;
|
||||||
|
@ -15,11 +15,7 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
|||||||
import com.intellectualcrafters.plot.util.*;
|
import com.intellectualcrafters.plot.util.*;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@CommandDeclaration(
|
@CommandDeclaration(
|
||||||
command = "setflag",
|
command = "setflag",
|
||||||
@ -250,8 +246,11 @@ public class FlagCmd extends SubCommand {
|
|||||||
}
|
}
|
||||||
String message = "";
|
String message = "";
|
||||||
String prefix = "";
|
String prefix = "";
|
||||||
for (Map.Entry<String, ArrayList<String>> stringArrayListEntry : flags.entrySet()) {
|
for (Map.Entry<String, ArrayList<String>> entry : flags.entrySet()) {
|
||||||
message += prefix + "&6" + stringArrayListEntry.getKey() + ": &7" + StringMan.join(stringArrayListEntry.getValue(), ", ");
|
String category = entry.getKey();
|
||||||
|
List<String> flagNames = entry.getValue();
|
||||||
|
Collections.sort(flagNames);
|
||||||
|
message += prefix + "&6" + category + ": &7" + StringMan.join(flagNames, ", ");
|
||||||
prefix = "\n";
|
prefix = "\n";
|
||||||
}
|
}
|
||||||
MainUtil.sendMessage(player, message);
|
MainUtil.sendMessage(player, message);
|
||||||
|
Loading…
Reference in New Issue
Block a user