mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Update to use alphabetical sorting
This commit is contained in:
parent
77bd84f35d
commit
e1f986ae53
|
@ -14,6 +14,7 @@ import org.bukkit.command.CommandSender;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -31,9 +32,15 @@ public class HelpCommand extends PKCommand {
|
|||
else if (args.size() == 0) {
|
||||
List<String> strings = new ArrayList<String>();
|
||||
for (PKCommand command : instances.values()) {
|
||||
strings.add(command.getProperUse());
|
||||
if (!command.getName().equalsIgnoreCase("help")) {
|
||||
strings.add(command.getProperUse());
|
||||
}
|
||||
}
|
||||
for (String s : getPage(strings, ChatColor.GOLD + "Commands: <required> [optional]", 1)) {
|
||||
Collections.sort(strings);
|
||||
Collections.reverse(strings);
|
||||
strings.add(instances.get("help").getProperUse());
|
||||
Collections.reverse(strings);
|
||||
for (String s : getPage(strings, ChatColor.GOLD + "Commands: <required> [optional]", 1, false)) {
|
||||
sender.sendMessage(ChatColor.YELLOW + s);
|
||||
}
|
||||
return;
|
||||
|
@ -46,7 +53,7 @@ public class HelpCommand extends PKCommand {
|
|||
for (PKCommand command : instances.values()) {
|
||||
strings.add(command.getProperUse());
|
||||
}
|
||||
for (String s : getPage(strings, ChatColor.GOLD + "Commands: <required> [optional]", Integer.valueOf(arg))) {
|
||||
for (String s : getPage(strings, ChatColor.GOLD + "Commands: <required> [optional]", Integer.valueOf(arg), true)) {
|
||||
sender.sendMessage(ChatColor.YELLOW + s);
|
||||
}
|
||||
} else if (instances.keySet().contains(arg.toLowerCase())) {//bending help command
|
||||
|
|
|
@ -135,7 +135,7 @@ public class WhoCommand extends PKCommand {
|
|||
//for (String st : players) {
|
||||
// sender.sendMessage(st);
|
||||
//}
|
||||
for (String s : getPage(players, ChatColor.GOLD + "Players:", page)) {
|
||||
for (String s : getPage(players, ChatColor.GOLD + "Players:", page, true)) {
|
||||
sender.sendMessage(s);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue