diff --git a/Towny/src/main/java/com/palmergames/bukkit/towny/TownySettings.java b/Towny/src/main/java/com/palmergames/bukkit/towny/TownySettings.java index c6502625a0..cdb0904b2b 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/towny/TownySettings.java +++ b/Towny/src/main/java/com/palmergames/bukkit/towny/TownySettings.java @@ -91,7 +91,8 @@ public record NationLevel( double peacefulCostMultiplier, double bankCapModifier, int nationZonesSize, - int nationBonusOutpostLimit) {} + int nationBonusOutpostLimit, + int nationCapitalBonusOutpostLimit) {} private static CommentedConfiguration config; private static CommentedConfiguration newConfig; @@ -153,7 +154,8 @@ public static void newNationLevel( double peacefulCostMultiplier, double bankCapModifier, int nationZonesSize, - int nationBonusOutpostLimit) { + int nationBonusOutpostLimit, + int nationCapitalBonusOutpostLimit) { configNationLevel.put(numResidents, new NationLevel( namePrefix, @@ -168,7 +170,8 @@ public static void newNationLevel( peacefulCostMultiplier, bankCapModifier, nationZonesSize, - nationBonusOutpostLimit + nationBonusOutpostLimit, + nationCapitalBonusOutpostLimit )); } @@ -249,7 +252,7 @@ public static void loadNationLevelConfig() throws TownyException { // Some configs end up having their numResident: 0 level removed which causes big errors. // Add a 0 level nation_level here which may get replaced when the config's nation_levels are loaded below. - newNationLevel(0, "Land of ", " (Nation)", "", "", "Leader ", "", 10, 1.0, 1.0, 1.0, 1.0, 1, 0); + newNationLevel(0, "Land of ", " (Nation)", "", "", "Leader ", "", 10, 1.0, 1.0, 1.0, 1.0, 1, 0, 0); List> levels = config.getMapList("levels.nation_level"); for (int i = 0; i < levels.size(); i++) { @@ -273,7 +276,8 @@ public static void loadNationLevelConfig() throws TownyException { levelGetAndParse(level, description, numResidentsIndex, "peacefulCostMultiplier", 1.0, Double::parseDouble), levelGetAndParse(level, description, numResidentsIndex, "bankCapModifier", 1.0, Double::parseDouble), levelGetAndParse(level, description, numResidentsIndex, "nationZonesSize", 1, Integer::parseInt), - levelGetAndParse(level, description, numResidentsIndex, "nationBonusOutpostLimit", 1, Integer::parseInt) + levelGetAndParse(level, description, numResidentsIndex, "nationBonusOutpostLimit", 0, Integer::parseInt), + levelGetAndParse(level, description, numResidentsIndex, "nationCapitalBonusOutpostLimit", 0, Integer::parseInt) ); } catch (Exception e) { Towny.getPlugin().getLogger().warning("An exception occurred when a loading nation level with " + numResidentsIndex + ", this can be caused by having an outdated nation_level section."); @@ -1305,6 +1309,8 @@ public static int getMaxOutposts(Town town) { Nation nation = town.getNationOrNull(); if (nation != null) nationOutposts = nation.getNationLevel().nationBonusOutpostLimit(); + if (town.isCapital()) + nationOutposts += nation.getNationLevel().nationCapitalBonusOutpostLimit(); } return townOutposts + nationOutposts; diff --git a/Towny/src/main/resources/ChangeLog.txt b/Towny/src/main/resources/ChangeLog.txt index d424d2c691..6c9a83ed7e 100644 --- a/Towny/src/main/resources/ChangeLog.txt +++ b/Towny/src/main/resources/ChangeLog.txt @@ -9919,4 +9919,10 @@ v0.92.0.11: - New Config Option: resident_settings.min_time_to_join_town - Default: 0m - How long does a resident have to wait to join a town, after joining the server. - - Set to 0m to disable. 1m = 1 minute, 1h = 1 hour, 1d = 1 day. \ No newline at end of file + - Set to 0m to disable. 1m = 1 minute, 1h = 1 hour, 1d = 1 day. + - Added the ability to give Nation Capitals an additional bonus number of outposts. + - Requires that your config has limit_outposts_using_town_and_nation_levels set to true. + - In the nation_level sections of your config a new setting will be added: nationCapitalBonusOutpostLimit. + - The amount set there will be added to a nation capital (in addition to the already applied nationBonusOutpostLimit amount.) + - Closes #7447. + - Automatic Config Edit: nationCapitalBonusOutpostLimit will be added to each nation_level section with a value of 0. \ No newline at end of file diff --git a/Towny/src/main/resources/config-migration.json b/Towny/src/main/resources/config-migration.json index 494cab0ac5..a13086590e 100644 --- a/Towny/src/main/resources/config-migration.json +++ b/Towny/src/main/resources/config-migration.json @@ -865,5 +865,15 @@ "key": "update_farm_blocks" } ] + }, + { + "version": "0.100.3.9", + "changes": [ + { + "type": "NATION_LEVEL_ADD", + "key": "nationCapitalBonusOutpostLimit", + "value": "0" + } + ] } ] \ No newline at end of file