@EventHandler
    public void onPlayerLogin(final PlayerLoginEvent event) {
        String player = event.getPlayer().getName();

        /**
         * Check if the player is banned.
         *
         * Kick with the appropriate message if so.
         */
        if (this.plugin.isBanned(player)) {
            event.setKickMessage(this.plugin.buildKickMessage(this.plugin.why(player)));
            event.setResult(PlayerLoginEvent.Result.KICK_BANNED);
            return;
        }

        /**
         * Check if any of the player's previous names where banned while they were
         * using it.
         */
        Map<Integer, String> history = this.plugin.getNameHistory(event.getPlayer().getUniqueId());
        for (int ts : history.keySet()) {
            String previousName = history.get(ts);

            if (this.plugin.isBanned(previousName)) {
                Event previousEvent = this.plugin.getActiveEvent(previousName);

                if (this.plugin.hadNameAtTime(event.getPlayer().getUniqueId(), previousName, previousEvent.getTime())) {
                    event.setKickMessage(this.plugin.buildKickMessage(this.plugin.why(previousName)));
                    event.setResult(PlayerLoginEvent.Result.KICK_BANNED);
                    return;
                }
            }
        }

        /**
         * Start the player's task.
         *
         * This will make sure the player is kicked if a temporary unban expires, or
         * if a ban is added externally.
         */
        this.taskMap.put(
            player,
            this.plugin.getServer().getScheduler().scheduleSyncRepeatingTask(this.plugin,new PlayerTask(this.plugin,player),20 * 60,20 * 60)
        );
    }