-
Notifications
You must be signed in to change notification settings - Fork 3
fix: if you type /bp now, the latest applied filters are still there (menu doesn't reset anymore) #73
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
base: master
Are you sure you want to change the base?
Conversation
…(menu doesn't reset anymore)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the block palette menu behavior so that typing /bp now retains the previously applied filters instead of resetting to defaults. It also introduces /bp menu as an explicit command to reset filters to defaults.
Changes:
- Modified command structure to differentiate between
/bp(remembers filters) and/bp menu(resets to defaults) - Swapped primary command name from
blockpalettetobpin plugin.yml, making the shorter alias the primary command - Added null safety check in ModuleHandler to prevent NullPointerException when disabled modules list is null
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main/resources/plugin.yml | Changed primary command from blockpalette to bp, updated aliases and usage text |
| src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java | Split /bp and /bp menu logic to support filter persistence vs reset behavior, updated help message |
| src/main/java/net/buildtheearth/modules/ModuleHandler.java | Added null check for disabled modules list to prevent potential NullPointerException |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bp: | ||
| description: Opens the block palette menu. | ||
| usage: /blockpalette [filter|menu|filter <filter1> <filter2> ...] | ||
| aliases: [bp, blocks] | ||
| usage: /bp [filter|menu|filter <filter1> <filter2> ...] | ||
| aliases: [blockpalette, blocks] |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command registration in MiscModule.java uses "blockpalette", but plugin.yml now defines "bp" as the primary command with "blockpalette" as an alias. While this should still work functionally (since aliases are registered), it creates inconsistency. Consider updating the registration to use "bp" to match the new primary command name in plugin.yml.
| List<?> disabled = BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES); | ||
| if (disabled == null) disabled = new ArrayList<>(); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change to add null checking for the disabled modules list appears to be an unrelated bug fix that was included in this PR. While the change is good (it prevents a NullPointerException if the config list is null), it's a best practice to keep PRs focused on a single purpose. Consider separating unrelated bug fixes into their own PRs for clearer change tracking and easier code review.
| } | ||
| } | ||
|
|
||
|
|
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This extra blank line appears to be an unintentional addition. Consider removing it to maintain consistent formatting with the rest of the file.
…(menu doesn't reset anymore)