Add block filtering feature with whitelist and blacklist settings#70
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a configurable BlockFilter (material-level whitelist/blacklist) to control which block types the debug stick can interact with, and bumps the config version to roll out the new settings.
Changes:
- Added
BlockFilter(Whitelist/Blacklist) toconfig.ymland loaded it intoConfigFile. - Enforced block material filtering during interaction checks (via new
BlockFilterUtil). - Added a new bypass permission (
debugstickpro.bypassblockfilter) and bumpedCONFIG_VERSIONto 7.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/plugin.yml | Adds the debugstickpro.bypassblockfilter permission and wires it into the admin permission group. |
| src/main/resources/config.yml | Bumps ConfigVersion to 7 and introduces BlockFilter whitelist/blacklist configuration. |
| src/main/java/dev/twme/debugstickpro/utils/BlockFilterUtil.java | New utility implementing whitelist/blacklist + permission bypass logic for materials. |
| src/main/java/dev/twme/debugstickpro/utils/AutoCheckCanChangeUtil.java | Applies BlockFilter as part of the “can change block” gating logic. |
| src/main/java/dev/twme/debugstickpro/mode/copy/CopyLeftClick.java | Import ordering only (no behavioral change). |
| src/main/java/dev/twme/debugstickpro/mode/classic/ClassicLeftClick.java | Adds BlockFilter enforcement for classic left-click selection. |
| src/main/java/dev/twme/debugstickpro/DebugStickPro.java | Updates CONFIG_VERSION constant to 7 and expands listener imports explicitly. |
| src/main/java/dev/twme/debugstickpro/config/ConfigLoader.java | Loads new BlockFilter settings from YAML into ConfigFile. |
| src/main/java/dev/twme/debugstickpro/config/ConfigFile.java | Adds new ConfigFile.BlockFilter configuration structure. |
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.
Introduce a block filtering mechanism that allows users to configure whitelists and blacklists for block interactions. This feature enhances control over which blocks can be manipulated using the debug stick. Update the configuration version to accommodate these changes.