mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-16 23:55:23 +01:00
Canning isOwnerOfAll() and isMemberOfAll() of ApplicableRegionSet.
This commit is contained in:
parent
e0ab79bd36
commit
129412ba79
@ -108,39 +108,6 @@ public boolean allows(StateFlag flag, LocalPlayer player) {
|
||||
return internalGetState(flag, null, player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether a player is an owner of all regions in this set.
|
||||
*
|
||||
* @param player player
|
||||
* @return whether the player is an owner of all regions
|
||||
*/
|
||||
public boolean isOwnerOfAll(LocalPlayer player) {
|
||||
for (Region region : applicable) {
|
||||
if (!region.isOwner(player)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether a player is an owner or member of all regions in
|
||||
* this set.
|
||||
*
|
||||
* @param player player
|
||||
* @return whether the player is a member of all regions
|
||||
*/
|
||||
public boolean isMemberOfAll(LocalPlayer player) {
|
||||
for (Region region : applicable) {
|
||||
if (!region.isMember(player)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if a flag is permitted.
|
||||
*
|
||||
@ -395,6 +362,7 @@ public int size() {
|
||||
/**
|
||||
* Get an iterator of affected regions.
|
||||
*/
|
||||
@Override
|
||||
public Iterator<Region> iterator() {
|
||||
return applicable.iterator();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user