Skip to content

Commit

Permalink
- New PAPI Placeholder:
Browse files Browse the repository at this point in the history
%townyadvanced_player_location_town_forsale_cost%
    - Displays the cost of the town at the player's location, or "Not
for sale." if it is not for sale.
    - Closes #7708.
  • Loading branch information
LlmDl committed Dec 29, 2024
1 parent ba5cd6b commit bccf644
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,11 @@ private String getPlayerPlaceholder(Player player, String identifier) {
.filter(t -> t.isNeutral())
.filter(t -> t.getHomeblockWorld().equals(townblock.getWorld()))
.count());
case "player_location_town_forsale_cost": // %townyadvanced_player_location_town_forsale_cost%
return townblock == null ? "" :
townblock.getTownOrNull().isForSale()
? getMoney(townblock.getTownOrNull().getForSalePrice())
: Translation.of("msg_not_for_sale");
default:
return null;
}
Expand Down
5 changes: 4 additions & 1 deletion Towny/src/main/resources/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10192,4 +10192,7 @@ v0.92.0.11:
- Works only on Paper servers.
- This will prevent Towny from remove mobs spawned by Trial Chambers, which resulted in unearned rewards.
- Closes #7709.
- New Config Migration: ",TRIAL_SPAWNER" will be added automatically to existing configs' town_mob_removal_ignored_spawn_causes list.
- New Config Migration: ",TRIAL_SPAWNER" will be added automatically to existing configs' town_mob_removal_ignored_spawn_causes list.
- New PAPI Placeholder: %townyadvanced_player_location_town_forsale_cost%
- Displays the cost of the town at the player's location, or "Not for sale." if it is not for sale.
- Closes #7708.

0 comments on commit bccf644

Please sign in to comment.