mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-14 18:44:48 +02:00
New permission: essentials.sleepingignored
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user