1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 22:56:41 +02:00

Ignore stupid plugins which add empty permission nodes.

This commit is contained in:
ElgarL
2012-08-06 07:05:20 +01:00
parent 0b0c3f99e9
commit 18f4158616

View File

@@ -214,26 +214,31 @@ public class BukkitPermissions {
List<String> result = new ArrayList<String>();
for (String key : permList) {
String a = key.charAt(0) == '-' ? key.substring(1) : key;
Map<String, Boolean> allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet<String>());
if (allchildren != null) {
ListIterator<String> itr = result.listIterator();
while (itr.hasNext()) {
String node = (String) itr.next();
String b = node.charAt(0) == '-' ? node.substring(1) : node;
// Insert the parent node before the child
if (allchildren.containsKey(b)) {
itr.set(key);
itr.add(node);
break;
/*
* Ignore stupid plugins which add empty permission nodes.
*/
if (!key.isEmpty()) {
String a = key.charAt(0) == '-' ? key.substring(1) : key;
Map<String, Boolean> allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet<String>());
if (allchildren != null) {
ListIterator<String> itr = result.listIterator();
while (itr.hasNext()) {
String node = (String) itr.next();
String b = node.charAt(0) == '-' ? node.substring(1) : node;
// 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;