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

Prevent vanished players from being in plot kick autocompletion #4485

Conversation

PapiCapi
Copy link
Contributor

Overview

Fixes #4484

Description

I added the parameter PlotPlayer<?> issuer to the method TabCompletions#completePlayersInPlot to be able to call the PlotPlayer#canSee method. Moreover, it makes sense to me that a player should be supplied to this method to have its "personalized" completions.
I didn't add null check in my if block as the parameter is already annotated with @NonNull.

Submitter Checklist

Preview Give feedback

@PapiCapi PapiCapi requested a review from a team as a code owner August 18, 2024 11:44
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Aug 18, 2024
Copy link
Member

@SirYwell SirYwell left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@PierreSchwang
Copy link
Member

Not sure if this is expected to be public API and should rather be deprecated instead of changing the signature without keeping compatibility?

@PapiCapi
Copy link
Contributor Author

If you want, i can create another method with the same signature as the initial one but i don't really understand why TabCompletions should be part of the API

@PierreSchwang
Copy link
Member

If you want, i can create another method with the same signature as the initial one but i don't really understand why TabCompletions should be part of the API

It's a static method available for use by addons, which might register Commands themselves and use the Tab-Completion logic. In the end, it's most likely a very small chance - so both is fine for me ig

@PierreSchwang PierreSchwang merged commit e1ccda3 into IntellectualSites:main Aug 30, 2024
7 checks passed
@PapiCapi PapiCapi deleted the fix/vanished-players-autocompletion branch August 30, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Players can see vanished players using the /p kick
4 participants