From 26cb7464e18552188bfea7aff505fd452cda2b08 Mon Sep 17 00:00:00 2001 From: Gnat008 Date: Sat, 11 Jun 2016 20:49:15 -0400 Subject: [PATCH] Re-add a scheduled task --- .../authme/process/join/AsynchronousJoin.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java index ee19a02d8..19a1ba634 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -223,6 +223,28 @@ public class AsynchronousJoin implements AsynchronousProcess { final int registrationTimeout = service.getProperty(RestrictionSettings.TIMEOUT) * 20; + bukkitService.scheduleSyncDelayedTask(new Runnable() { + @Override + public void run() { + player.setOp(false); + if (!service.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT) + && service.getProperty(RestrictionSettings.REMOVE_SPEED)) { + player.setFlySpeed(0.0f); + player.setWalkSpeed(0.0f); + } + player.setNoDamageTicks(registrationTimeout); + if (pluginHooks.isEssentialsAvailable() && service.getProperty(HooksSettings.USE_ESSENTIALS_MOTD)) { + player.performCommand("motd"); + } + if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { + // Allow infinite blindness effect + int blindTimeOut = (registrationTimeout <= 0) ? 99999 : registrationTimeout; + player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindTimeOut, 2)); + } + } + + }); + // Apply effects // TODO: clenup! player.setOp(false);