Search in sources :

Example 1 with TimeoutTask

use of fr.xephi.authme.task.TimeoutTask in project AuthMeReloaded by AuthMe.

the class LimboPlayerTaskManager method registerTimeoutTask.

/**
     * Registers a {@link TimeoutTask} for the given player according to the configuration.
     *
     * @param player the player to register a timeout task for
     * @param limbo the associated limbo player
     */
void registerTimeoutTask(Player player, LimboPlayer limbo) {
    final int timeout = settings.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND;
    if (timeout > 0) {
        String message = messages.retrieveSingle(MessageKey.LOGIN_TIMEOUT_ERROR);
        BukkitTask task = bukkitService.runTaskLater(new TimeoutTask(player, message, playerCache), timeout);
        limbo.setTimeoutTask(task);
    }
}
Also used : BukkitTask(org.bukkit.scheduler.BukkitTask) TimeoutTask(fr.xephi.authme.task.TimeoutTask)

Aggregations

TimeoutTask (fr.xephi.authme.task.TimeoutTask)1 BukkitTask (org.bukkit.scheduler.BukkitTask)1