Skip to content

Add Menu Refresh Task and Command for Complete Menu Rebuilding #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 8, 2025

Conversation

BitByLogics
Copy link
Contributor

This PR introduces a refresh task that enhances dynamic menu management beyond the existing placeholder task. While the placeholder task only updates item names and lore, the refresh task calls the refreshMenu method, enabling comprehensive menu updates including:

  • View requirement validation
  • Conditional termination of the placeholder update task when no longer needed

This functionality was implemented as a separate task because it rebuilds the entire menu, which would be inappropriate to include in the update task that focuses on lightweight item modifications.

Menus must explicitly opt-in to this functionality by setting refresh: true in their configuration. The refresh interval is configurable via the refresh_interval setting, which specifies the frequency of refresh operations in seconds.

Additionally, this PR adds a /dm refresh <menu> [-s] command, allowing external plugins to trigger menu refreshes for all players with the specified menu open. The optional -s flag suppresses console feedback messages.

@BitByLogics
Copy link
Contributor Author

Just wanted to give this a light ping! Let me know if there's any feedback you'd like me to address! Appreciate your time.

BlitzOffline
BlitzOffline previously approved these changes Apr 25, 2025
Copy link
Member

@BlitzOffline BlitzOffline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. In the past we've refused to add this option for performance reasons but I think its time to move on and let server owners decide whether they want accept the possible performance hits or not.

@kristophergeo
Copy link

Very nice feature, I just tested it. Thanks for your contribution to DeluxeMenus, @BitByLogics 💖

@Kqliber
Copy link
Member

Kqliber commented May 30, 2025

This will be ready to be merged in the coming days, if you could resolve the conflicts that would be greatly appreciated

…ements

# Conflicts:
#	src/main/java/com/extendedclip/deluxemenus/command/DeluxeMenusCommand.java
#	src/main/java/com/extendedclip/deluxemenus/utils/Messages.java
BlitzOffline
BlitzOffline previously approved these changes May 31, 2025
…mand imports with a wildcard, and add missing RefreshCommand import
@Kqliber Kqliber merged commit 6775b7f into HelpChat:main Jun 8, 2025
2 checks passed
Euphillya added a commit to Euphillya/DeluxeMenus-Folia that referenced this pull request Jul 11, 2025
HelpChat@a465d9a Fix light_level being overwritten for LIGHT item. (HelpChat#200)
HelpChat@41b2476 Fix MMO-Items not working when item id contains colon(s). (HelpChat#194)
HelpChat@87141c0 Improve metadata / PDC usage (HelpChat#183)
HelpChat@bc699b8 improve bstats (HelpChat#202)
HelpChat@a20c30d update adventure for 1.21.5 (HelpChat#201)
HelpChat@f048028 Fix exception that occurs when trying to add metadata. (HelpChat#205)
HelpChat@08fbb34 fix command event action (HelpChat#206)
HelpChat@d512986 Added support for the new CustomModelDataComponent (HelpChat#195)
HelpChat@4f05d70 Finally, a release (HelpChat#207)
HelpChat@9fc732f Moved to 1.14.2-dev and added CODE_OF_CONDUCT.md & CONTRIBUTING.md files (HelpChat#212)
HelpChat@6775b7f Add Menu Refresh Task and Command for Complete Menu Rebuilding (HelpChat#189)
HelpChat@4ae3bf6 fix README.md link (HelpChat#214)
HelpChat@d884d8d Add gitbook badge (HelpChat#215)
HelpChat@944a113 Add [log] Action to Output Console Messages for Debugging/Testing, Closes HelpChat#199 (HelpChat#208)
HelpChat@94d6632 fix for textures not showing on player name heads (HelpChat#213)
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.

None yet

4 participants