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

Make CommandSourceStack respect hidden players #11556

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

notTamion
Copy link
Contributor

fixes #11545

@notTamion notTamion requested a review from a team as a code owner November 1, 2024 17:18
@lynxplay
Copy link
Contributor

lynxplay commented Nov 1, 2024

We have this diff already

+ // Paper start - tell clients to ask server for suggestions for EntityArguments
+ final Collection<String> collection;
+ if (icompletionprovider instanceof CommandSourceStack commandSourceStack && commandSourceStack.getEntity() instanceof ServerPlayer sourcePlayer) {
+ collection = new java.util.ArrayList<>();
+ for (final ServerPlayer player : commandSourceStack.getServer().getPlayerList().getPlayers()) {
+ if (sourcePlayer.getBukkitEntity().canSee(player.getBukkitEntity())) {
+ collection.add(player.getGameProfile().getName());
+ }
+ }
+ } else {
+ collection = icompletionprovider.getOnlinePlayerNames();
+ }
+ // Paper end - tell clients to ask server for suggestions for EntityArguments

Either we remove this or duplicate it.
Idk what else calls this method and if that is of interest to maybe not solve as deep.

@notTamion
Copy link
Contributor Author

its only called by argument types so i think fixing this that deep is the correct solution.
image

@lynxplay
Copy link
Contributor

lynxplay commented Nov 1, 2024

Okay, thanks for the quick check 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting final testing
Development

Successfully merging this pull request may close these issues.

Players aren't hidden in the /team command
4 participants