48 $playerNames = array_map(
function(
Player $player) :
string{
50 }, array_filter($sender->getServer()->getOnlinePlayers(),
function(
Player $player) use ($sender) :
bool{
51 return !($sender instanceof
Player) || $sender->canSee($player);
53 sort($playerNames, SORT_STRING);
55 $sender->sendMessage(KnownTranslationFactory::commands_players_list((
string) count($playerNames), (
string) $sender->getServer()->getMaxPlayers()));
56 $sender->sendMessage(implode(
", ", $playerNames));