New permission: essentials.sleepingignored

This commit is contained in:
snowleo 2011-07-15 20:13:52 +02:00
parent cecb9867d9
commit ae7275c7ad
2 changed files with 42 additions and 38 deletions

View File

@ -268,6 +268,9 @@ public class EssentialsPlayerListener extends PlayerListener
user.setDisplayName(user.getNick());
user.setAfk(false);
if (user.isAuthorized("essentials.sleepingignored")) {
user.setSleepingIgnored(true);
}
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{

View File

@ -117,6 +117,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
takeMoney(value, null);
}
public void takeMoney(double value, CommandSender initiator)
{
if (value == 0)
@ -306,7 +307,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override
public void setAfk(boolean set)
{
this.setSleepingIgnored(set);
this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : set);
super.setAfk(set);
}
@ -314,7 +315,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public boolean toggleAfk()
{
boolean now = super.toggleAfk();
this.setSleepingIgnored(now);
this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : now);
return now;
}
}