mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-12 11:21:34 +01:00
Don't check region group if the flag value is null.
This commit is contained in:
parent
0f10e89f7c
commit
095f2aa67e
@ -390,25 +390,28 @@ public <V> V getEffectiveFlag(final ProtectedRegion region, Flag<V> flag, @Nulla
|
||||
|
||||
while (current != null) {
|
||||
V value = current.getFlag(flag);
|
||||
boolean use = true;
|
||||
|
||||
if (flag.getRegionGroupFlag() != null) {
|
||||
RegionGroup group = current.getFlag(flag.getRegionGroupFlag());
|
||||
if (group == null) {
|
||||
group = flag.getRegionGroupFlag().getDefault();
|
||||
if (value != null) {
|
||||
boolean use = true;
|
||||
|
||||
if (flag.getRegionGroupFlag() != null) {
|
||||
RegionGroup group = current.getFlag(flag.getRegionGroupFlag());
|
||||
if (group == null) {
|
||||
group = flag.getRegionGroupFlag().getDefault();
|
||||
}
|
||||
|
||||
if (subject == null) {
|
||||
use = group.contains(Association.NON_MEMBER);
|
||||
} else if (!group.contains(subject.getAssociation(region))) {
|
||||
use = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (subject == null) {
|
||||
use = group.contains(Association.NON_MEMBER);
|
||||
} else if (!group.contains(subject.getAssociation(region))) {
|
||||
use = false;
|
||||
if (use) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
if (use && value != null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
current = current.getParent();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user