diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 15eb4a57b..fa90bc91f 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -849,32 +849,6 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, parent::sendSkin($targets ?? $this->server->getOnlinePlayers()); } - /** - * Gets the player IP address - * - * @return string - */ - public function getAddress() : string{ - return $this->networkSession->getIp(); - } - - /** - * @return int - */ - public function getPort() : int{ - return $this->networkSession->getPort(); - } - - /** - * Returns the last measured latency for this player, in milliseconds. This is measured automatically and reported - * back by the network interface. - * - * @return int - */ - public function getPing() : int{ - return $this->networkSession->getPing(); - } - /** * Returns whether the player is currently using an item (right-click and hold). * @return bool diff --git a/src/pocketmine/command/defaults/BanIpCommand.php b/src/pocketmine/command/defaults/BanIpCommand.php index c27b65221..6f10b192d 100644 --- a/src/pocketmine/command/defaults/BanIpCommand.php +++ b/src/pocketmine/command/defaults/BanIpCommand.php @@ -62,7 +62,7 @@ class BanIpCommand extends VanillaCommand{ Command::broadcastCommandMessage($sender, new TranslationContainer("commands.banip.success", [$value])); }else{ if(($player = $sender->getServer()->getPlayer($value)) instanceof Player){ - $ip = $player->getAddress(); + $ip = $player->getNetworkSession()->getIp(); $this->processIPBan($ip, $sender, $reason); Command::broadcastCommandMessage($sender, new TranslationContainer("commands.banip.success.players", [$ip, $player->getName()])); @@ -80,7 +80,7 @@ class BanIpCommand extends VanillaCommand{ $sender->getServer()->getIPBans()->addBan($ip, $reason, null, $sender->getName()); foreach($sender->getServer()->getOnlinePlayers() as $player){ - if($player->getAddress() === $ip){ + if($player->getNetworkSession()->getIp() === $ip){ $player->kick($reason !== "" ? $reason : "IP banned."); } }