mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
WhitelistCommand: sort output of /whitelist list into lexical order
This commit is contained in:
parent
a60fc4cc28
commit
3b961d0e5f
@ -31,7 +31,9 @@ use pocketmine\Player;
|
|||||||
use pocketmine\utils\TextFormat;
|
use pocketmine\utils\TextFormat;
|
||||||
use function count;
|
use function count;
|
||||||
use function implode;
|
use function implode;
|
||||||
|
use function sort;
|
||||||
use function strtolower;
|
use function strtolower;
|
||||||
|
use const SORT_STRING;
|
||||||
|
|
||||||
class WhitelistCommand extends VanillaCommand{
|
class WhitelistCommand extends VanillaCommand{
|
||||||
|
|
||||||
@ -71,6 +73,7 @@ class WhitelistCommand extends VanillaCommand{
|
|||||||
return true;
|
return true;
|
||||||
case "list":
|
case "list":
|
||||||
$entries = $sender->getServer()->getWhitelisted()->getAll(true);
|
$entries = $sender->getServer()->getWhitelisted()->getAll(true);
|
||||||
|
sort($entries, SORT_STRING);
|
||||||
$result = implode($entries, ", ");
|
$result = implode($entries, ", ");
|
||||||
$count = count($entries);
|
$count = count($entries);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user