Don't run calls against bucket api in async login thread

This commit is contained in:
snowleo 2013-01-30 00:26:50 +01:00
parent 12786a260e
commit cef8cf7b75

View file

@ -175,13 +175,18 @@ public class EssentialsPlayerListener implements Listener
updateCompass(user);
user.setLastLogin(System.currentTimeMillis());
user.updateActivity(false);
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
if (!ess.getVanishedPlayers().isEmpty() && !user.isAuthorized("essentials.vanish.see"))
{
for (String p : ess.getVanishedPlayers())
{
Player toVanish = ess.getUser(p).getBase();
if (toVanish.isOnline())
Player toVanish = ess.getServer().getPlayerExact(p);
if (toVanish != null && toVanish.isOnline())
{
user.hidePlayer(toVanish);
}
@ -189,16 +194,9 @@ public class EssentialsPlayerListener implements Listener
}
if (user.isAuthorized("essentials.sleepingignored"))
{
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
user.setSleepingIgnored(true);
}
});
}
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{
@ -257,6 +255,8 @@ public class EssentialsPlayerListener implements Listener
}
}
}
});
}
// Makes the compass item ingame always point to the first essentials home. #EasterEgg
private void updateCompass(final User user)