Skip to content

Commit 506f3d2

Browse files
committed
- Fix outposts not following the
min_distances_ignored_for_towns_in_same_nation and min_distances_ignored_for_towns_in_allied_nation when min_distance_for_outpost_from_plot is tested while creating an outpost using /t claim outpost. - Closes #7829.
1 parent 87f59b5 commit 506f3d2

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

Towny/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<artifactId>towny</artifactId>
1515
<packaging>jar</packaging>
16-
<version>0.102.0.7</version>
16+
<version>0.102.0.8</version>
1717

1818
<licenses>
1919
<license>

Towny/src/main/java/com/palmergames/bukkit/towny/command/PlotCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ public void parsePlotSetOutpost(Player player, Resident resident, TownBlock town
755755
Coord key = Coord.parseCoord(player.getLocation());
756756

757757
// Throws a TownyException with message if outpost should not be set.
758-
OutpostUtil.OutpostTests(town, resident, townyWorld, key, resident.isAdmin(), true);
758+
OutpostUtil.OutpostTests(town, resident, townyWorld, key, resident.isAdmin());
759759

760760
if (TownySettings.getOutpostCost() > 0) {
761761
// Create a confirmation for setting outpost.

Towny/src/main/java/com/palmergames/bukkit/towny/command/TownCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3515,7 +3515,7 @@ private static List<WorldCoord> getTownClaimSelectionOrThrow(Player player, Stri
35153515

35163516
Resident resident = getResidentOrThrow(player);
35173517
// Run various tests required by configuration/permissions through Util.
3518-
OutpostUtil.OutpostTests(town, resident, world, playerWorldCoord, resident.isAdmin(), false);
3518+
OutpostUtil.OutpostTests(town, resident, world, playerWorldCoord, resident.isAdmin());
35193519

35203520
if (playerWorldCoord.hasTownBlock())
35213521
throw new TownyException(Translatable.of("msg_already_claimed", playerWorldCoord.getTownOrNull()));

Towny/src/main/java/com/palmergames/bukkit/towny/utils/OutpostUtil.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717

1818
public class OutpostUtil {
1919

20-
/**
21-
* Checks to make sure all requirements are met before an outpost can be claimed.
22-
* Will check:
23-
* - If there are not enough free outpost plots
24-
* - If the Outpost does not meet a minimum-distance requirement
20+
/**
21+
* Checks to make sure all requirements are met before an outpost can be
22+
* claimed. Will check: <br>
23+
*
24+
* - If there are not enough free outpost plots<br>
25+
* - If the Outpost does not meet a minimum-distance requirement
26+
*
27+
* @param town Town the outpost belongs to
28+
* @param resident Resident establishing the outpost
29+
* @param world TownyWorld in which the outpost will be in
30+
* @param key Coordinates where the outpost would be established
31+
* @param isAdmin If the Resident is a Towny Administrator
2532
*
26-
* @param town - Town the outpost belongs to
27-
* @param resident - Resident establishing the outpost
28-
* @param world - TownyWorld in which the outpost will be in
29-
* @param key - Coordinates where the outpost would be established
30-
* @param isAdmin - If the Resident is a Towny Administrator
31-
* @param isPlotSetOutpost - If a plot is already an outpost
32-
*
3333
* @return - Returns true if all required tests for outposts are met.
3434
* @throws TownyException if a condition is not met.
3535
*/
36-
public static boolean OutpostTests(Town town, Resident resident, TownyWorld world, Coord key, boolean isAdmin, boolean isPlotSetOutpost) throws TownyException {
36+
public static boolean OutpostTests(Town town, Resident resident, TownyWorld world, Coord key, boolean isAdmin) throws TownyException {
3737

3838
// The config can be set up to dole out numbers of outposts to towns based on resident counts/belonging to a nation.
3939
if (TownySettings.isOutpostsLimitedByLevels() && (town.getMaxOutpostSpawn() >= town.getOutpostLimit()))
@@ -67,7 +67,7 @@ public static boolean OutpostTests(Town town, Resident resident, TownyWorld worl
6767
throw new TownyException(Translatable.of("msg_err_not_close_enough_to_your_town_nearest_plot", distance, maxDistance));
6868
}
6969
// Outposts can have a minimum required distance from other towns' townblocks.
70-
int minDistance = world.getMinDistanceFromOtherTownsPlots(key, isPlotSetOutpost ? town : null);
70+
int minDistance = world.getMinDistanceFromOtherTownsPlots(key, town);
7171
// Outposts can have a minimum required distance from other outposts.
7272
if (minDistance < TownySettings.getMinDistanceFromTownPlotblocks() ||
7373
minDistance < TownySettings.getMinDistanceForOutpostsFromPlot())

Towny/src/main/resources/ChangeLog.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10698,4 +10698,8 @@ v0.92.0.11:
1069810698
- Closes #8100.
1069910699
- Add PLOT_GROUP_TOGGLE to TownyCommandAddonAPI, courtesy of Veyronity with PR #8107.
1070010700
- Bump me.clip:placeholderapi from 2.11.7 to 2.12.2.
10701-
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.14.1 to 3.15.0.
10701+
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.14.1 to 3.15.0.
10702+
0.102.0.8:
10703+
- Fix outposts not following the min_distances_ignored_for_towns_in_same_nation and min_distances_ignored_for_towns_in_allied_nation
10704+
when min_distance_for_outpost_from_plot is tested while creating an outpost using /t claim outpost.
10705+
- Closes #7829.

0 commit comments

Comments
 (0)