Defer island saves until settings panel closes; apply click cooldown to all buttons#2926
Merged
tastybento merged 2 commits intodevelopfrom Apr 8, 2026
Merged
Conversation
- Add beginDeferSaves()/endDeferSaves() to Island to batch flag changes into a single database save when the panel is closed - Move click cooldown check from TabbedPanel to PanelListenerManager so it runs before click handlers and panel refresh - TabbedPanel tracks refreshing state to distinguish true close from refresh close for deferred save handling - Add tests for defer save mechanism and timeout check Agent-Logs-Url: https://github.com/BentoBoxWorld/BentoBox/sessions/4f416153-32a9-45a2-bc46-568b590c8266 Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add cooldown to all buttons in settings menu
Defer island saves until settings panel closes; apply click cooldown to all buttons
Apr 7, 2026
|
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.



Rapid clicking on settings menu buttons causes severe TPS drops (2-3 TPS with two players) because every flag change triggers an immediate database write via
Island.setChanged()→IslandsManager.updateIsland(), and the existing click cooldown only applied to tab switches after click handlers already executed.Deferred saves (
Island.java,TabbedPanel.java)beginDeferSaves()/endDeferSaves()onIsland— while deferred,setChanged()marks dirty but skips the DB writeTabbedPanelbegins deferring on first open, ends on true close (single save)refreshingflag distinguishes panel rebuilds from actual inventory close eventsClick cooldown moved upstream (
PanelListenerManager.java)onTimeoutcheck moved fromTabbedPanel.onInventoryClick()toPanelListenerManager.onInventoryClick()before click handlers and panel refresh executeTabbedPanellisteners only — other panels unaffected