Skip to content

Conversation

@Jasupa
Copy link
Contributor

@Jasupa Jasupa commented Jan 20, 2026

…(menu doesn't reset anymore)

@Zoriot Zoriot added ⏰ medium priority This currently has medium priority. 🦐 small size This is a small issue. labels Jan 20, 2026
@Zoriot Zoriot added this to the Release v0.2.0 milestone Jan 20, 2026
@Zoriot Zoriot linked an issue Jan 20, 2026 that may be closed by this pull request
@Zoriot Zoriot requested review from Zoriot and Copilot January 20, 2026 18:22
Copy link
Contributor

Copilot AI left a 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 blockpalette to bp in 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.

Comment on lines +44 to +47
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]
Copy link

Copilot AI Jan 20, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +49
List<?> disabled = BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES);
if (disabled == null) disabled = new ArrayList<>();
Copy link

Copilot AI Jan 20, 2026

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 uses AI. Check for mistakes.
}
}


Copy link

Copilot AI Jan 20, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⏰ medium priority This currently has medium priority. 🦐 small size This is a small issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block Pallet System

2 participants