Skip to content

Commit

Permalink
Alter the order that outposts are marked, use outpost naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
LlmDl committed Jun 7, 2024
1 parent 872b83e commit 6d2bf61
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/dynmap/towny/mapupdate/UpdateTowns.java
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,11 @@ private void addStyle(Town town, AreaMarker m, TownBlockType btype) {
*/

private void drawTownMarkers(Town town, Map<String, Marker> newWorldNameMarkerMap, String townName, String desc) {
if (town.hasOutpostSpawn())
drawOutpostIcons(town, newWorldNameMarkerMap, desc);

/* Now, add marker for home block */
TownBlock homeBlock = town.getHomeBlockOrNull();

if (homeBlock != null && isVisible(townName, homeBlock.getWorld().getName())) {
MarkerIcon townHomeBlockIcon = getMarkerIcon(town);

Expand All @@ -443,8 +445,6 @@ private void drawTownMarkers(Town town, Map<String, Marker> newWorldNameMarkerMa
drawHomeBlockSpawn(newWorldNameMarkerMap, townName, desc, homeBlock, townHomeBlockIcon);
}

if (town.hasOutpostSpawn())
drawOutpostIcons(town, newWorldNameMarkerMap, desc);
}

private MarkerIcon getMarkerIcon(Town town) {
Expand Down Expand Up @@ -492,8 +492,9 @@ private void drawOutpostIcons(Town town, Map<String, Marker> newWorldNameMarkerM

double xx = TOWNBLOCKSIZE * townBlock.getX() + (TOWNBLOCKSIZE / 2);
double zz = TOWNBLOCKSIZE * townBlock.getZ() + (TOWNBLOCKSIZE / 2);
String outpostName = town.getName() + "_Outpost_" + i;
String outpostMarkerID = outpostName;
String outpostMarkerID = town.getName() + "_Outpost_" + i;
String outpostName = town.getName() + " Outpost" +
(townBlock.getName().isEmpty() ? " " + i : ": " + townBlock.getName());
Marker outpostMarker = existingMarkers.remove(outpostMarkerID);
if (outpostMarker == null) {
outpostMarker = set.createMarker(outpostMarkerID, outpostName, townBlock.getWorld().getName(), xx, 64, zz, outpostIco, true);
Expand Down

0 comments on commit 6d2bf61

Please sign in to comment.