Merge with master

This commit is contained in:
Olof Larsson
2011-10-25 17:52:14 +02:00
3 changed files with 31 additions and 2 deletions

View File

@@ -512,6 +512,24 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
}
}
public boolean canClaimForFaction(Faction forFaction)
{
if (forFaction.isNone()) return false;
if
(
this.isAdminBypassing()
|| (forFaction == this.getFaction() && this.getRole().isAtLeast(Role.MODERATOR))
|| (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer()))
|| (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer()))
)
{
return true;
}
return false;
}
public boolean canClaimForFactionAtLocation(Faction forFaction, Location location, boolean notifyFailure)
{
String error = null;