hopefully fix server stopped responding error with SkipListSet

This commit is contained in:
Luck 2016-08-29 16:28:36 +01:00
parent 02d9b996a7
commit 35cb5b81dc
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -39,7 +39,6 @@ import me.lucko.luckperms.groups.Group;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -139,8 +138,7 @@ public abstract class PermissionHolder {
* @return a set of nodes * @return a set of nodes
*/ */
public SortedSet<Node> getAllNodes(List<String> excludedGroups) { public SortedSet<Node> getAllNodes(List<String> excludedGroups) {
SortedSet<Node> all = new ConcurrentSkipListSet<>(PRIORITY_COMPARATOR); SortedSet<Node> all = getPermissions();
all.addAll(getPermissions());
if (excludedGroups == null) { if (excludedGroups == null) {
excludedGroups = new ArrayList<>(); excludedGroups = new ArrayList<>();
@ -536,6 +534,10 @@ public abstract class PermissionHolder {
@Override @Override
public int compare(Node o1, Node o2) { public int compare(Node o1, Node o2) {
if (o1.equals(o2)) {
return 0;
}
if (o1.isOverride() != o2.isOverride()) { if (o1.isOverride() != o2.isOverride()) {
return o1.isOverride() ? 1 : -1; return o1.isOverride() ? 1 : -1;
} }