Skip to content

Commit

Permalink
Move update check message out of MOTD task (EssentialsX#4410)
Browse files Browse the repository at this point in the history
Update message will now show after mail, and will not be affected by insane MOTD delays.
  • Loading branch information
JRoy authored Aug 9, 2021
1 parent 2fa9c64 commit 5334a3f
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,14 @@ public void run() {
}
}

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())) {
Expand Down Expand Up @@ -440,14 +448,6 @@ public void run() {
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);
}
});
}
}
}
}
Expand Down

0 comments on commit 5334a3f

Please # to comment.