mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 13:13:24 +00:00
Ignore stupid plugins which add empty permission nodes.
This commit is contained in:
parent
73fb2d3735
commit
a7a06963ac
1 changed files with 22 additions and 17 deletions
|
@ -214,26 +214,31 @@ public class BukkitPermissions {
|
||||||
List<String> result = new ArrayList<String>();
|
List<String> result = new ArrayList<String>();
|
||||||
|
|
||||||
for (String key : permList) {
|
for (String key : permList) {
|
||||||
String a = key.charAt(0) == '-' ? key.substring(1) : key;
|
/*
|
||||||
Map<String, Boolean> allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet<String>());
|
* Ignore stupid plugins which add empty permission nodes.
|
||||||
if (allchildren != null) {
|
*/
|
||||||
|
if (!key.isEmpty()) {
|
||||||
ListIterator<String> itr = result.listIterator();
|
String a = key.charAt(0) == '-' ? key.substring(1) : key;
|
||||||
|
Map<String, Boolean> allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet<String>());
|
||||||
while (itr.hasNext()) {
|
if (allchildren != null) {
|
||||||
String node = (String) itr.next();
|
|
||||||
String b = node.charAt(0) == '-' ? node.substring(1) : node;
|
ListIterator<String> itr = result.listIterator();
|
||||||
|
|
||||||
// Insert the parent node before the child
|
while (itr.hasNext()) {
|
||||||
if (allchildren.containsKey(b)) {
|
String node = (String) itr.next();
|
||||||
itr.set(key);
|
String b = node.charAt(0) == '-' ? node.substring(1) : node;
|
||||||
itr.add(node);
|
|
||||||
break;
|
// Insert the parent node before the child
|
||||||
|
if (allchildren.containsKey(b)) {
|
||||||
|
itr.set(key);
|
||||||
|
itr.add(node);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!result.contains(key))
|
||||||
|
result.add(key);
|
||||||
}
|
}
|
||||||
if (!result.contains(key))
|
|
||||||
result.add(key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue