Skip to content
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

Add blacklist support to CommandWhitelist #98

Closed
wants to merge 1 commit into from

Conversation

UltimateBoi
Copy link

@UltimateBoi UltimateBoi commented Jan 15, 2025

Fixes #95

Add support for blacklisting commands to protect velocity's command.

  • Add methods addToBlacklist and removeFromBlacklist in CWCommand.java to manage blacklisted commands.
  • Update helpComponent method in CWCommand.java to include blacklist commands in the help message.
  • Add blacklist field in CWGroup.java to store blacklisted commands.
  • Add methods addToBlacklist and removeFromBlacklist in CWGroup.java to manage the blacklist.
  • Update serialize method in CWGroup.java to include the blacklist.
  • Add method getBlacklistedCommands in CommandWhitelistVelocity.java to retrieve blacklisted commands.
  • Update onUserCommandExecuteEvent and onUserTabCompleteEvent in CommandWhitelistVelocity.java to check for and filter out blacklisted commands.
  • Add subcommands blacklist add and blacklist remove in VelocityMainCommand.java to manage the blacklist.
  • Update help message in VelocityMainCommand.java to include the new blacklist commands.

Possible solution to this problem (enhancement). Cant test right now, OP of #95 could test?

Fixes YouHaveTrouble#95

Add support for blacklisting commands to protect velocity's command.

* Add methods `addToBlacklist` and `removeFromBlacklist` in `CWCommand.java` to manage blacklisted commands.
* Update `helpComponent` method in `CWCommand.java` to include blacklist commands in the help message.
* Add `blacklist` field in `CWGroup.java` to store blacklisted commands.
* Add methods `addToBlacklist` and `removeFromBlacklist` in `CWGroup.java` to manage the blacklist.
* Update `serialize` method in `CWGroup.java` to include the blacklist.
* Add method `getBlacklistedCommands` in `CommandWhitelistVelocity.java` to retrieve blacklisted commands.
* Update `onUserCommandExecuteEvent` and `onUserTabCompleteEvent` in `CommandWhitelistVelocity.java` to check for and filter out blacklisted commands.
* Add subcommands `blacklist add` and `blacklist remove` in `VelocityMainCommand.java` to manage the blacklist.
* Update help message in `VelocityMainCommand.java` to include the new blacklist commands.

Possible solution to this problem (enhancement). Cant test right now, OP of issue YouHaveTrouble#95 could test?
@YouHaveTrouble
Copy link
Owner

As I mentioned in the linked issue, this is beyond the scope of the plugin and honestly makes UX worse. What's the behavior when command is both on the whitelist and blacklist at the same time? User has to make an assumption here.

Project is open source and therefore I do not have issues with forks adding functionality beyond the original scope. Project was created to have a single list and this brings the same issues of complexity I wished to fix by making cw initially.

@UltimateBoi UltimateBoi deleted the add-blacklist branch January 22, 2025 11:23
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.

How time support BlackList
2 participants