From 7f228b648a4e809ac0f86b24183f9678bd435c69 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 30 Jul 2012 23:28:23 +0200 Subject: [PATCH] Some servers might want to disable territorial warfare alltogether. --- 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 c0e2f0a4..261d2a3d 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -129,6 +129,7 @@ public class Conf public static boolean permanentFactionsDisableLeaderPromotion = false; public static boolean claimsMustBeConnected = false; + public static boolean claimingFromOthersAllowed = true; public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true; public static int claimsRequireMinFactionMembers = 1; public static int claimedLandsMax = 0; diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index c4ffcedc..4823432c 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -575,6 +575,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { error = P.p.txt.parse("Limit reached. You can't claim more land!"); } + else if ( ! Conf.claimingFromOthersAllowed && currentFaction.isNormal()) + { + error = P.p.txt.parse("You may not claim land from others."); + } 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.");