Skip to content

Clean placeholders service - #3054

Open
Lemvs wants to merge 1 commit into
BG-Software-LLC:devfrom
Lemvs:feature/clean-placeholders-service
Open

Lemvs wants to merge 1 commit into
BG-Software-LLC:devfrom
Lemvs:feature/clean-placeholders-service

Conversation

@Lemvs

@Lemvs Lemvs commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Changelog

  • Fixed 'list' placeholders that threw errors when the list was empty.
  • Added a safeguard against null dimensions for world_enabled/generated/unlocked placeholders
  • Added support for parsing dimension names containing underscores in generator_amount and generator_percentage placeholders.
  • Split the island_mission_status placeholder into player_mission_status and island_mission_status, rather than handling both variants within island_mission_status, for consistent with how other mission placeholders works..
  • Added support for parsing sorting type names containing underscores in top placeholders.
  • Changed the way sorting type names are stored upon creation, ensuring they are in uppercase, for consistent with other similar classes - Dimension, IslandFlag, IslandPrivilege. Previously, the case-sensitivity made parsing difficult.
  • Removed the redundant passing of both a placeholder and a sub-placeholder to parsePlaceholdersForIsland(), because the sub-placeholder alone is enough. Previously, the implementation was inconsistent, sometimes using the main placeholder and other times the sub-placeholder.
  • Added check not null preconditions to registerPlaceholder() methods.
  • Refactored and cleaned up whole placeholders service implementation, with other small changes.

I also discovered an issue - player placeholders and certain island placeholders (I’ve temporarily removed this condition for island placeholders while waiting for a better, comprehensive solution from you) that accept additional arguments required the SuperiorPlayer object to be NotNull. However, standard placeholders (from static ImmutableMap) had no such requirement, which could lead to exceptions being thrown. For player placeholders, the fix is ​​straightforward - simply require the SuperiorPlayer to be NotNull. It’s a bit more complex for island placeholders, though, since we allow the parsing of any island-related placeholder for an island at a specific position in the 'top' rankings, which can be parsed for not a player - how should we handle this effectively? Most of the placeholders (with the exception of the permission placeholder) actually require a Locale rather than a SuperiorPlayer object - which could otherwise serve as a source for the default locale - but the parser provided in the API relies on the SuperiorPlayer object. I’m not sure how to resolve this in a sensible way, so I’m leaving it as is for now and awaiting your response.

And don't worry - this time I’ve verified that all the placeholders work.

@OmerBenGera

Copy link
Copy Markdown
Member

Give me an example of such placeholder that requires a player

@Lemvs

Lemvs commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Give me an example of such placeholder that requires a player

After a thorough analysis %superior_island_permission_<permission_name>%, %superior_island_is_coop/leader/member/visitor% and %superior_island_discord/paypal%. The other island placeholders which use a superior player actually need it to get the locale, used in formatters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants