Add placeholder browser GUI and dump command (#1332)#2803
Merged
tastybento merged 4 commits intodevelopfrom Feb 22, 2026
Merged
Add placeholder browser GUI and dump command (#1332)#2803tastybento merged 4 commits intodevelopfrom
tastybento merged 4 commits intodevelopfrom
Conversation
- `/bbox placeholders` (alias `ph`) opens a hierarchical GUI showing all registered placeholders grouped by source (BentoBox core + each addon). The panel layout is customisable via `BentoBox/panels/placeholder_panel.yml` and `placeholder_list_panel.yml`. - `/bbox dump-placeholders` writes `plugins/BentoBox/placeholder-dump.md`, a Markdown table of every placeholder and its plain-English description, suitable for the BentoBoxWorld/docs site. Data-layer changes: - `BasicPlaceholderExpansion` stores a description alongside each replacer and tracks a disabled-placeholder set for in-memory toggle. - `PlaceholderHook` / `PlaceholderAPIHook` gain description-aware overloads, enable/disable API, and introspection methods (getRegisteredPlaceholders, getAddonsWithPlaceholders, getDescription). - `PlaceholdersManager` exposes the same API publicly and fixes a bug where only the first placeholder per addon was tracked. - `GameModePlaceholder` constants now carry a plain-English description string. Scalability improvements for large placeholder sets: - `PlaceholderGrouper` collapses numeric-suffix series (e.g. island_member_name_1..50) into a single Series item, reducing thousands of rows to a handful. - `PlaceholderNode` builds a `_`-split trie with path compression (single-child FOLDER chains are merged) for efficient tree navigation. - `PlaceholderListPanel` uses the trie for drill-down navigation with five node types (LEAF/FOLDER/LEAF_FOLDER/SERIES/LEAF_SERIES), each with appropriate icons and left/right-click semantics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change panel title colour from &6 (gold) to &3 (dark aqua) for readability against the grey inventory background. - Remove the " Placeholders" suffix from the list-panel title and show only the current node label (not the full breadcrumb path), keeping the title within Minecraft's ~22-char bold-text limit. - Wrap long placeholder descriptions at 38 characters per line so text like "Number of members currently online on the island the player is standing on" is split across readable lore lines instead of overflowing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each placeholder item in the list panel now shows the current value for the viewing player alongside the description: - LEAF / LEAF_FOLDER: one "→ <value>" line (or "→ (empty)" if blank) - SERIES / LEAF_SERIES: up to 3 sample lines "#N → <value>" for the first N members of the series, so admins can verify the values without leaving the GUI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ests
- PlaceholderPanel: hide the BentoBox core placeholder button when no
core placeholders are registered (currently always 0), avoiding a
confusing "0 core placeholders" entry in the GUI.
- PlaceholderListPanel: fix LEAF_SERIES button name — series.displayKey()
already contains "_{N}", so appending it again produced "stem_{N}_{N}".
- Add PlaceholderGrouperTest (18 tests) covering: empty input, plain
single keys, numeric-suffix series detection, min/max tracking, raw-key
ordering, stem-also-registered-as-single case, output sorting,
description lookup, series description stripping, and the
stripTrailingHashNumber helper.
- Add PlaceholderNodeTest (19 tests) covering: empty trie, single/series
node construction, all five NodeType values, path compression (stops at
leaf, series, and multi-child nodes; partial compression for fan-out
chains), alphabetic sort of display children, totalPlaceholderCount
(leaf / series / recursive), and drill-into navigation of a compressed
node.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Implements #1332.
/bbox placeholders(aliasph) — player-only command that opens a hierarchical GUI showing all registered placeholders grouped by source (one button per addon). Clicking an addon opens a drill-down tree navigator that splits keys on_and applies path compression to avoid empty intermediate folders. Layout is customisable viaBentoBox/panels/placeholder_panel.ymlandplaceholder_list_panel.yml./bbox dump-placeholders— console/admin command that writesplugins/BentoBox/placeholder-dump.md, a Markdown table of every placeholder and its plain-English description, suitable for the BentoBoxWorld/docs site. Numeric series are collapsed (e.g. 50island_member_name_Nrows → one row with range annotation).Data-layer changes
BasicPlaceholderExpansionstores a description alongside each replacer and tracks a disabled-placeholder set for in-memory toggle (state resets on restart).PlaceholderHook/PlaceholderAPIHookgain description-aware overloads, enable/disable API, and introspection methods (getRegisteredPlaceholders,getAddonsWithPlaceholders,getDescription). Also fixes a bug where only the first placeholder per addon expansion was tracked.PlaceholdersManagerexposes the same API publicly.GameModePlaceholderconstants now carry a plain-Englishdescriptionstring shown in the GUI and dump.Scalability (handles addons with thousands of placeholders)
PlaceholderGroupercollapses numeric-suffix series (island_member_name_1..50→ oneSeriesitem).PlaceholderNodebuilds a_-split trie with path compression (single-child FOLDER chains are merged) for efficient tree navigation.PlaceholderListPaneluses the trie for drill-down with five node types —LEAF/FOLDER/LEAF_FOLDER/SERIES/LEAF_SERIES— each with distinct icons (PAPER / CHEST / BOOK / NAME_TAG / WRITABLE_BOOK) and left/right-click semantics.GUI details
&3(dark aqua) for readability against the grey inventory background.→ <value>or→ (empty)). Series items show up to 3 sample values (#1 → …,#2 → …,#3 → …).""instead of their resolved value).Test plan
./gradlew test)PlaceholderGrouper(grouping, series detection, description stripping, sorting)PlaceholderNode(trie construction, all 5 node types, path compression, counting, drill-in navigation)/bbox placeholdersopens the browser GUI in-game; addon buttons show correct icons and counts/bbox dump-placeholderswritesplaceholder-dump.mdwith collapsed series rows and range annotationsBentoBox/panels/🤖 Generated with Claude Code