Skip to content

Preserve addon placeholders across /bbox reload (#2930)#2931

Merged
tastybento merged 1 commit intodevelopfrom
fix/2930-placeholder-reload
Apr 9, 2026
Merged

Preserve addon placeholders across /bbox reload (#2930)#2931
tastybento merged 1 commit intodevelopfrom
fix/2930-placeholder-reload

Conversation

@tastybento
Copy link
Copy Markdown
Member

Summary

  • Fixes Placeholder bug #2930: addon placeholders such as %level_aoneblock_island_level% silently stop resolving after /bbox reload.
  • BentoBoxReloadCommand was calling PlaceholderAPIHook.unregisterAll(), which wiped every registered placeholder including ones owned by third-party addons. The reload then only re-registered gamemode-default placeholders, so addon expansions were left cached with empty maps and onPlaceholderRequest returned null. Addons are not actually disabled by reload, so their replacers were still valid — they were just thrown away.
  • Narrow PlaceholderAPIHook.unregisterAll() to only clear the BentoBox-core expansion, add a targeted unregisterAll(Addon) overload, and have the reload command clear only the gamemode addons it knows how to rebuild.

Test plan

  • ./gradlew test --tests "world.bentobox.bentobox.managers.PlaceholdersManagerTest"
  • Manual: install BentoBox + AOneBlock + Level + PlaceholderAPI on a Paper test server, display %level_aoneblock_island_level% in tab/scoreboard, run /bbox reload, confirm the placeholder still resolves.

🤖 Generated with Claude Code

The reload command was wiping every registered placeholder via
PlaceholderAPIHook.unregisterAll(), but only re-registered the
gamemode-default ones afterwards. Addons are not actually disabled by
reload, so addon-registered placeholders (e.g. %level_..._island_level%
from the Level addon) were left as orphaned, empty entries inside
cached AddonPlaceholderExpansion instances and silently stopped
resolving.

Narrow PlaceholderAPIHook.unregisterAll() to only clear the BentoBox
core expansion, add a targeted unregisterAll(Addon) overload, and have
BentoBoxReloadCommand clear only the gamemode addons it knows how to
rebuild.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tastybento tastybento merged commit 4741603 into develop Apr 9, 2026
1 check passed
@tastybento tastybento deleted the fix/2930-placeholder-reload branch April 9, 2026 02:38
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

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.

Placeholder bug

1 participant