Merge pull request #90 from first4ever/master

Max Faction Land

Added a "claimedLandsMax" option in config

(answering to issue "Max Faction Land" :
https://github.com/MassiveCraft/Factions/issues/88 )
This commit is contained in:
Brett Flannigan 2012-02-02 11:03:05 -08:00
commit 9bc6d01a4b
2 changed files with 4 additions and 0 deletions

View File

@ -123,6 +123,7 @@ public class Conf
public static boolean claimsMustBeConnected = false; public static boolean claimsMustBeConnected = false;
public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true; public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true;
public static int claimsRequireMinFactionMembers = 1; public static int claimsRequireMinFactionMembers = 1;
public static int claimedLandsMax = 0;
//public static double considerFactionsReallyOfflineAfterXMinutes = 0.0; //public static double considerFactionsReallyOfflineAfterXMinutes = 0.0;

View File

@ -580,6 +580,9 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
{ {
error = P.p.txt.parse("<b>You can't claim more land! You need more power!"); error = P.p.txt.parse("<b>You can't claim more land! You need more power!");
} }
else if (ownedLand >= Conf.claimedLandsMax && Conf.claimedLandsMax != 0) {
error = P.p.txt.parse("<b>Limit reached. You can't claim more land!");
}
else if (currentFaction.getRelationTo(forFaction).isAtLeast(Rel.TRUCE) && ! currentFaction.isNone()) else if (currentFaction.getRelationTo(forFaction).isAtLeast(Rel.TRUCE) && ! currentFaction.isNone())
{ {
error = P.p.txt.parse("<b>You can't claim this land due to your relation with the current owner."); error = P.p.txt.parse("<b>You can't claim this land due to your relation with the current owner.");