From 9e11cc03dec4ca3a23a4c428ffe68052961ff53f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 13 Dec 2020 21:38:11 +0000 Subject: [PATCH] Server: get rid of matchPlayer() the functionality of this API method is too specialized to be of any practical use. In addition, a search on Poggit reveals that the only uses of this API method are abuses or incorrect uses anyway. --- src/Server.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/Server.php b/src/Server.php index c9f57410c..f0ba676bd 100644 --- a/src/Server.php +++ b/src/Server.php @@ -634,27 +634,6 @@ class Server{ return null; } - /** - * Returns a list of online players whose names contain with the given string (case insensitive). - * If an exact match is found, only that match is returned. - * - * @return Player[] - */ - public function matchPlayer(string $partialName) : array{ - $partialName = strtolower($partialName); - $matchedPlayers = []; - foreach($this->getOnlinePlayers() as $player){ - if(strtolower($player->getName()) === $partialName){ - $matchedPlayers = [$player]; - break; - }elseif(stripos($player->getName(), $partialName) !== false){ - $matchedPlayers[] = $player; - } - } - - return $matchedPlayers; - } - /** * Returns the player online with the specified raw UUID, or null if not found */