class RegisterAdminCommand implements ExecutableCommand {

    @Override
    public void executeCommand(final CommandSender sender, List<String> arguments) {
        // Get the player name and password
        final String playerName = arguments.get(0);
        final String playerPass = arguments.get(1);
        final String playerNameLowerCase = playerName.toLowerCase();

        // Command logic
        ValidationResult passwordValidation = validationService.validatePassword(playerPass, playerName);
        if (passwordValidation.hasError()) {
            commonService.send(sender, passwordValidation.getMessageKey(), passwordValidation.getArgs());
            return;
        }

        bukkitService.runTaskOptionallyAsync(() -> {
            if (dataSource.isAuthAvailable(playerNameLowerCase)) {
                commonService.send(sender, MessageKey.NAME_ALREADY_REGISTERED);
                return;
            }
            HashedPassword hashedPassword = passwordSecurity.computeHash(playerPass, playerNameLowerCase);
            PlayerAuth auth = PlayerAuth.builder()
                .name(playerNameLowerCase)
                .realName(playerName)
                .password(hashedPassword)
                .registrationDate(System.currentTimeMillis())
                .build();

            if (!dataSource.saveAuth(auth)) {
                commonService.send(sender, MessageKey.ERROR);
                return;
            }

            commonService.send(sender, MessageKey.REGISTER_SUCCESS);
            ConsoleLogger.info(sender.getName() + " registered " + playerName);
            final Player player = bukkitService.getPlayerExact(playerName);
            if (player != null) {
                bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() ->
                    player.kickPlayer(commonService.retrieveSingleMessage(player, MessageKey.KICK_FOR_ADMIN_REGISTER)));
            }
        });
    }

}