PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

Prevent vanished players from being in plot kick autocompletion

Open PapiCapi opened this issue 1 year ago • 3 comments

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
- [x] Make sure you are opening from a topic branch (**/feature/fix/docs/ branch** (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [x] New public fields and methods are annotated with `@since TODO`.
- [x] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).

PapiCapi avatar Aug 18 '24 11:08 PapiCapi

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

PierreSchwang avatar Aug 28 '24 10:08 PierreSchwang

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

PapiCapi avatar Aug 28 '24 11:08 PapiCapi

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 avatar Aug 28 '24 11:08 PierreSchwang