From a1fcda003d45dc58ad20c1bbb93abcbc978b9fce Mon Sep 17 00:00:00 2001 From: first4ever Date: Tue, 31 Jan 2012 23:30:24 +0100 Subject: [PATCH] Added a "claimedLandsMax" option in config (answering to issue "Max Faction Land" : https://github.com/MassiveCraft/Factions/issues/88 ) --- src/com/massivecraft/factions/Conf.java | 1 + src/com/massivecraft/factions/FPlayer.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index edbcb0e6..3db7e811 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -123,6 +123,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 a205b114..e8a5f038 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -580,6 +580,9 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { error = P.p.txt.parse("You can't claim more land! You need more power!"); } + else if (ownedLand >= Conf.claimedLandsMax && Conf.claimedLandsMax != 0) { + error = P.p.txt.parse("Limit reached. You can't claim more land!"); + } else if (currentFaction.getRelationTo(forFaction).isAtLeast(Rel.TRUCE) && ! currentFaction.isNone()) { error = P.p.txt.parse("You can't claim this land due to your relation with the current owner.");