WhitelistCommand: sort output of /whitelist list into lexical order

This commit is contained in:
Dylan K. Taylor 2020-07-03 11:19:23 +01:00
parent a60fc4cc28
commit 3b961d0e5f

View File

@ -31,7 +31,9 @@ use pocketmine\Player;
use pocketmine\utils\TextFormat;
use function count;
use function implode;
use function sort;
use function strtolower;
use const SORT_STRING;
class WhitelistCommand extends VanillaCommand{
@ -71,6 +73,7 @@ class WhitelistCommand extends VanillaCommand{
return true;
case "list":
$entries = $sender->getServer()->getWhitelisted()->getAll(true);
sort($entries, SORT_STRING);
$result = implode($entries, ", ");
$count = count($entries);