From a124ac6e3523586eebca5578cfd68c006b278685 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Thu, 2 Feb 2012 13:12:54 -0600 Subject: [PATCH] (by first4ever) Added a "claimedLandsMax" option (default 0, no limit), which prevents normal factions from being able to claim more land once they've reached this limit. --- src/com/massivecraft/factions/Conf.java | 1 + src/com/massivecraft/factions/FPlayer.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index ce03cd19..8081e294 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -113,6 +113,7 @@ public class Conf public static boolean claimsMustBeConnected = false; public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true; public static int claimsRequireMinFactionMembers = 1; + public static int claimedLandsMax = 0; public static double considerFactionsReallyOfflineAfterXMinutes = 0.0; diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 98467ff8..822bc59b 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -723,6 +723,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { error = P.p.txt.parse("You can't claim more land! You need more power!"); } + else if (Conf.claimedLandsMax != 0 && ownedLand >= Conf.claimedLandsMax && forFaction.isNormal()) + { + error = P.p.txt.parse("Limit reached. You can't claim more land!"); + } else if (currentFaction.getRelationTo(forFaction) == Relation.ALLY) { error = P.p.txt.parse("You can't claim the land of your allies.");