autoclaim will now cancel beforehand if player isn't able to claim land for the specified faction

This commit is contained in:
Brettflan
2011-10-25 01:27:58 -05:00
parent 136b69b07f
commit d44ccda211
3 changed files with 31 additions and 2 deletions

View File

@@ -632,6 +632,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;