Skip to content

Commit 40d611d

Browse files
authored
Merge pull request #2932 from BentoBoxWorld/fix/2930-placeholder-reload-followup
Don't clear gamemode addon placeholders on reload (#2930 follow-up)
2 parents 4741603 + ce9b170 commit 40d611d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/java/world/bentobox/bentobox/commands/BentoBoxReloadCommand.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ public boolean execute(User user, String label, List<String> args) {
3939
if (args.isEmpty()) {
4040
this.askConfirmation(user, user.getTranslation("commands.bentobox.reload.warning"), () -> {
4141

42-
// Clear placeholders that this reload will rebuild. Addon-owned
43-
// placeholders (e.g. from the Level addon) are intentionally
44-
// preserved because reload does not re-invoke addons (#2930).
42+
// Clear only BentoBox-core placeholders. Addon-owned placeholders
43+
// (both gamemode defaults and any custom ones addons register
44+
// themselves) are intentionally preserved because reload does
45+
// not re-invoke addons (#2930). registerDefaultPlaceholders
46+
// below is idempotent, so any newly-added flag placeholders
47+
// will still be picked up.
4548
PlaceholdersManager pm = getPlugin().getPlaceholdersManager();
4649
pm.unregisterAll();
47-
getPlugin().getAddonsManager().getGameModeAddons().forEach(pm::unregisterAll);
4850

4951
// Close all open panels
5052
PanelListenerManager.closeAllPanels();

0 commit comments

Comments
 (0)