22declare(strict_types=1);
24namespace pocketmine\command\defaults;
32use
function inet_pton;
36 public function __construct(){
39 KnownTranslationFactory::pocketmine_command_unban_ip_description(),
40 KnownTranslationFactory::commands_unbanip_usage(),
43 $this->setPermission(DefaultPermissionNames::COMMAND_UNBAN_IP);
47 if(count($args) !== 1){
51 if(inet_pton($args[0]) !==
false){
52 $sender->getServer()->getIPBans()->remove($args[0]);
53 $sender->getServer()->getNetwork()->unblockAddress($args[0]);
54 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_unbanip_success($args[0]));
56 $sender->sendMessage(KnownTranslationFactory::commands_unbanip_invalid());
execute(CommandSender $sender, string $commandLabel, array $args)