diff --git a/src/com/palmergames/bukkit/config/ConfigNodes.java b/src/com/palmergames/bukkit/config/ConfigNodes.java index 8d47deab2e..9c47ea44af 100644 --- a/src/com/palmergames/bukkit/config/ConfigNodes.java +++ b/src/com/palmergames/bukkit/config/ConfigNodes.java @@ -210,6 +210,12 @@ public enum ConfigNodes { "", "# The maximum townblocks available to a town is (numResidents * ratio).", "# Setting this value to 0 will instead use the level based jump values determined in the town level config."), + TOWN_TOWN_BLOCK_LIMIT( + "town.town_block_limit", + "0", + "", + "# The maximimum amount of townblocks a town can have, if town_block_ratio is 0 the max size will be decided by the town_levels.", + "# Set to 0 to have no size limit."), TOWN_TOWN_BLOCK_SIZE( "town.town_block_size", "16", diff --git a/src/com/palmergames/bukkit/towny/TownySettings.java b/src/com/palmergames/bukkit/towny/TownySettings.java index 40e4f5cbd8..4d12d49b07 100644 --- a/src/com/palmergames/bukkit/towny/TownySettings.java +++ b/src/com/palmergames/bukkit/towny/TownySettings.java @@ -941,6 +941,10 @@ public static int getMaxTownBlocks(Town town) { n += town.getNumResidents() * ratio; n += getNationBonusBlocks(town); + + int ratioSizeLimit = getInt(ConfigNodes.TOWN_TOWN_BLOCK_LIMIT); + if (ratio != 0 && ratioSizeLimit > 0) + n = Math.min(ratioSizeLimit, n); return n; }