implement config toggle for afk users bypassing sleep

This commit is contained in:
triagonal 2018-12-30 20:38:34 +11:00
parent 246fd03265
commit 42714ff8af
4 changed files with 19 additions and 1 deletions

View file

@ -457,7 +457,7 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
return;
}
this.getBase().setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : set);
this.getBase().setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") || set && ess.getSettings().bypassSleepWhenAfk());
if (set && !isAfk()) {
afkPosition = this.getLocation();
this.afkSince = System.currentTimeMillis();