mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 19:55:33 +00:00
BanIpCommand: fix crash when banning by playername, closes #2578
This commit is contained in:
parent
c5262fdf61
commit
19edacbea9
@ -58,9 +58,10 @@ class BanIpCommand extends VanillaCommand{
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.banip.success", [$value]));
|
||||
}else{
|
||||
if(($player = $sender->getServer()->getPlayer($value)) instanceof Player){
|
||||
$this->processIPBan($player->getAddress(), $sender, $reason);
|
||||
$ip = $player->getAddress();
|
||||
$this->processIPBan($ip, $sender, $reason);
|
||||
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.banip.success.players", [$player->getAddress(), $player->getName()]));
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.banip.success.players", [$ip, $player->getName()]));
|
||||
}else{
|
||||
$sender->sendMessage(new TranslationContainer("commands.banip.invalid"));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user