mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-23 19:57:43 +00:00
New permission: essentials.sleepingignored
This commit is contained in:
parent
cecb9867d9
commit
ae7275c7ad
|
@ -268,6 +268,9 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||||
|
|
||||||
user.setDisplayName(user.getNick());
|
user.setDisplayName(user.getNick());
|
||||||
user.setAfk(false);
|
user.setAfk(false);
|
||||||
|
if (user.isAuthorized("essentials.sleepingignored")) {
|
||||||
|
user.setSleepingIgnored(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
|
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
{
|
{
|
||||||
takeMoney(value, null);
|
takeMoney(value, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void takeMoney(double value, CommandSender initiator)
|
public void takeMoney(double value, CommandSender initiator)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
|
@ -306,7 +307,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
@Override
|
@Override
|
||||||
public void setAfk(boolean set)
|
public void setAfk(boolean set)
|
||||||
{
|
{
|
||||||
this.setSleepingIgnored(set);
|
this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : set);
|
||||||
super.setAfk(set);
|
super.setAfk(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +315,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
public boolean toggleAfk()
|
public boolean toggleAfk()
|
||||||
{
|
{
|
||||||
boolean now = super.toggleAfk();
|
boolean now = super.toggleAfk();
|
||||||
this.setSleepingIgnored(now);
|
this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : now);
|
||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue