Move update check message out of MOTD task (#4410)

Update message will now show after mail, and will not be affected by insane MOTD delays.
This commit is contained in:
Josh Roy 2021-08-09 12:14:15 -07:00 committed by GitHub
parent 2fa9c6486e
commit 5334a3fd34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -378,6 +378,14 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
}
}
if (user.isAuthorized("essentials.updatecheck")) {
ess.runTaskAsynchronously(() -> {
for (String str : ess.getUpdateChecker().getVersionMessages(false, false)) {
user.sendMessage(str);
}
});
}
if (user.isAuthorized("essentials.fly.safelogin")) {
user.getBase().setFallDistance(0);
if (LocationUtil.shouldFly(user.getLocation())) {
@ -440,14 +448,6 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
final TextPager pager = new TextPager(output, true);
pager.showPage("1", null, "motd", user.getSource());
}
if (user.isAuthorized("essentials.updatecheck")) {
ess.runTaskAsynchronously(() -> {
for (String str : ess.getUpdateChecker().getVersionMessages(false, false)) {
user.sendMessage(str);
}
});
}
}
}
}