From 06f80825997e514171e6a099057c276ff0571159 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Mon, 25 Jul 2011 13:16:32 -0500 Subject: [PATCH] New conf.json option claimsRequireMinFactionMembers (defaults to 1, effectively disabled) which can be increased to prevent small (potentially one player) factions from claiming land until they have more members --- src/com/massivecraft/factions/Conf.java | 1 + src/com/massivecraft/factions/FPlayer.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index 13c8f39a..f4ee3a83 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -76,6 +76,7 @@ public class Conf { public static boolean claimsMustBeConnected = false; public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true; + public static int claimsRequireMinFactionMembers = 1; public static double considerFactionsReallyOfflineAfterXMinutes = 0; diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 851e3752..dceefb68 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -476,6 +476,11 @@ public class FPlayer { return false; } + if (myFaction.getFPlayers().size() < Conf.claimsRequireMinFactionMembers && !Conf.adminBypassPlayers.contains(this.playerName)) { + sendMessage("Your faction must have at least "+Conf.claimsRequireMinFactionMembers+" members to claim land."); + return false; + } + if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) { sendMessage("Sorry, this world has land claiming disabled."); return false;