Add player permissions check API
This commit is contained in:
parent
faa1948225
commit
8f9d2c01c2
8 changed files with 122 additions and 1 deletions
|
|
@ -276,6 +276,20 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Set<String> checkPlayerPermissions(String player, Set<String> perms) {
|
||||
OfflinePlayer p = getServer().getOfflinePlayer(player);
|
||||
if(p.isBanned())
|
||||
return new HashSet<String>();
|
||||
Set<String> rslt = permissions.hasOfflinePermissions(player, perms);
|
||||
if (rslt == null) {
|
||||
rslt = new HashSet<String>();
|
||||
if(p.isOp()) {
|
||||
rslt.addAll(perms);
|
||||
}
|
||||
}
|
||||
return rslt;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Player access abstraction class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue