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 PlayerCommandSendEvent listener to hide commands in autocomplete #2469

Merged
merged 2 commits into from Apr 15, 2019

Conversation

mdcfe
Copy link
Member

@mdcfe mdcfe commented Mar 31, 2019

Hides commands from the 1.13 autocomplete when players don't have permission to use them. Fixes #2297.

@mdcfe mdcfe added the type: enhancement Features and feature requests. label Mar 31, 2019
@mdcfe mdcfe modified the milestone: 2.17.0 Mar 31, 2019
@mdcfe mdcfe requested a review from drtshock April 3, 2019 19:48
event.getCommands().removeIf(str -> shouldHideFromUser(str, user));

removedCmds.removeAll(event.getCommands());
ess.getLogger().info("Removed commands: " + removedCmds.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be logged each time or just if debug is enabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, that should just be if debug is enabled. An earlier version of this wrapped this in a isDebug check but I must've removed it by mistake.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. Looks good otherwise!

@mdcfe mdcfe merged commit 8e4fc77 into EssentialsX:2.x Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Vanilla & Essentials overlapping commands and Tab Completions
3 participants