Re-add a scheduled task

This commit is contained in:
Gnat008 2016-06-11 20:49:15 -04:00
parent 4d75542594
commit 26cb7464e1

View File

@ -223,6 +223,28 @@ public class AsynchronousJoin implements AsynchronousProcess {
final int registrationTimeout = service.getProperty(RestrictionSettings.TIMEOUT) * 20; 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 // Apply effects
// TODO: clenup! // TODO: clenup!
player.setOp(false); player.setOp(false);