Added a "claimedLandsMax" option in config

(answering to issue "Max Faction Land" :
https://github.com/MassiveCraft/Factions/issues/88 )
This commit is contained in:
first4ever 2012-01-31 23:30:24 +01:00
parent 0abc3f397a
commit a1fcda003d
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.");