Convert player upgrade panel to BentoBox TemplatedPanel#79
Merged
tastybento merged 1 commit intodevelopfrom Feb 24, 2026
Merged
Convert player upgrade panel to BentoBox TemplatedPanel#79tastybento merged 1 commit intodevelopfrom
tastybento merged 1 commit intodevelopfrom
Conversation
Replaces the programmatic PanelBuilder with a YAML-driven TemplatedPanel,
allowing admins to customise the upgrade GUI layout without touching code.
- Add src/main/resources/panels/upgrades_panel.yml: default 6-row layout
with 3×7 upgrade slots (21 per page) and PREVIOUS/NEXT pagination buttons
- Rewrite Panel.java: uses TemplatedPanelBuilder with UPGRADE, NEXT, and
PREVIOUS type builders; adds a page field for pagination
- UpgradesAddon.onEnable: saveResource("panels/upgrades_panel.yml", false)
copies the template on first run without overwriting admin edits
- en-US.yml: add previous/next/upgrade locale keys under upgradepanel
- Update UpgradesAddonTest: include panels/upgrades_panel.yml in test JAR
- Update PanelTest: set up BentoBox singleton and temp data folder with
panel template so TemplatedPanelBuilder can build the inventory
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
PanelBuilderinPanel.javawith a YAML-drivenTemplatedPanelBuilder, separating layout from logicsrc/main/resources/panels/upgrades_panel.yml— a default 6-row layout with 3×7 upgrade slots (21 per page) and PREVIOUS/NEXT pagination buttons in the bottom rowUpgradesAddon.onEnablenow callssaveResource("panels/upgrades_panel.yml", false)to copy the template on first run without overwriting admin editsprevious,next, andupgradetooltip locale keys underupgradepanelinen-US.ymlAdmin customisation
Admins can edit
plugins/BentoBox/addons/Upgrades/panels/upgrades_panel.ymlto rearrange slots, change icons, add rows, etc. — no code changes needed.Pagination
More than 21 upgrades automatically gets a NEXT button on page 1 and a PREVIOUS button on page 2+. Each page shows 21 upgrades (3 rows × 7 cols).
Test plan
mvn test)/[gamemode] upgradesopens the panel with upgrades in the gridupgrades_panel.ymland reload — layout changes take effect🤖 Generated with Claude Code