mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-09-12 05:08:48 +00:00
Using base instead of our wrapped player for permission check.
This commit is contained in:
parent
057c9cb3f5
commit
d3dd4980a4
|
@ -50,6 +50,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
@Override
|
||||
public boolean isAuthorized(final String node)
|
||||
{
|
||||
if (base instanceof OfflinePlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isOp())
|
||||
{
|
||||
return true;
|
||||
|
@ -60,7 +65,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
return false;
|
||||
}
|
||||
|
||||
return ess.getPermissionsHandler().hasPermission(this, node);
|
||||
return ess.getPermissionsHandler().hasPermission(base, node);
|
||||
}
|
||||
|
||||
public void healCooldown() throws Exception
|
||||
|
@ -264,8 +269,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
|
||||
if (ess.getSettings().addPrefixSuffix())
|
||||
{
|
||||
final String prefix = ess.getPermissionsHandler().getPrefix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String suffix = ess.getPermissionsHandler().getSuffix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
|
||||
nickname.insert(0, prefix);
|
||||
nickname.append(suffix);
|
||||
|
@ -341,11 +346,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||
public void setAfk(final boolean set)
|
||||
{
|
||||
this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : set);
|
||||
if (set && !isAfk() && ess.getSettings().getFreezeAfkPlayers()) {
|
||||
if (set && !isAfk() && ess.getSettings().getFreezeAfkPlayers())
|
||||
{
|
||||
godStateBeforeAfk = isGodModeEnabled();
|
||||
setGodModeEnabled(true);
|
||||
}
|
||||
if (!set && isAfk() && ess.getSettings().getFreezeAfkPlayers()) {
|
||||
if (!set && isAfk() && ess.getSettings().getFreezeAfkPlayers())
|
||||
{
|
||||
setGodModeEnabled(godStateBeforeAfk);
|
||||
}
|
||||
super.setAfk(set);
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Permissions2Handler implements IPermissionsHandler
|
|||
@Override
|
||||
public boolean hasPermission(final Player base, final String node)
|
||||
{
|
||||
return permissionHandler.permission(base, node);
|
||||
return permissionHandler.permission(base.getWorld().getName(), base.getName(), node);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue