From 16053d0008730116733bce4d71ff178d7a948d21 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Wed, 20 Jul 2011 14:45:18 -0500 Subject: [PATCH] New conf.json option "claimsCanBeUnconnectedIfOwnedByOtherFaction" (default true) which, will allow claims to bypass the "claimsMustBeConnected" option if the attempted claim is vulnerable land controlled by another faction --- src/com/massivecraft/factions/Conf.java | 1 + src/com/massivecraft/factions/FPlayer.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index 877c49e3..91db6205 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -73,6 +73,7 @@ public class Conf { public static int noPVPDamageToOthersForXSecondsAfterLogin = 3; public static boolean claimsMustBeConnected = false; + public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true; public static double considerFactionsReallyOfflineAfterXMinutes = 0; diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 0e177938..d1bb73c7 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -503,8 +503,16 @@ public class FPlayer { return false; } - if (Conf.claimsMustBeConnected && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, myFaction)) { - sendMessage("You can only claim additional land which is connected to your first claim!"); + if ( + Conf.claimsMustBeConnected + && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 + && !Board.isConnectedLocation(flocation, myFaction) + && (!Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !otherFaction.isNormal()) + ) { + if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction) + sendMessage("You can only claim additional land which is connected to your first claim or controlled by another faction!"); + else + sendMessage("You can only claim additional land which is connected to your first claim!"); return false; }