diff --git a/Core/src/main/java/com/plotsquared/core/command/Kick.java b/Core/src/main/java/com/plotsquared/core/command/Kick.java index cf91f9ad2..5c9d07fc1 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Kick.java +++ b/Core/src/main/java/com/plotsquared/core/command/Kick.java @@ -153,7 +153,7 @@ public class Kick extends SubCommand { if (plot == null) { return Collections.emptyList(); } - return TabCompletions.completePlayersInPlot(plot, String.join(",", args).trim(), + return TabCompletions.completePlayersInPlot(player, plot, String.join(",", args).trim(), Collections.singletonList(player.getName()) ); } diff --git a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java index c9d1b3037..d5a341c5b 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java +++ b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java @@ -107,6 +107,7 @@ public final class TabCompletions { } public static @NonNull List completePlayersInPlot( + final @NonNull PlotPlayer issuer, final @NonNull Plot plot, final @NonNull String input, final @NonNull List existing ) { @@ -115,7 +116,9 @@ public final class TabCompletions { final List> inPlot = plot.getPlayersInPlot(); players = new ArrayList<>(inPlot.size()); for (PlotPlayer player : inPlot) { - players.add(player.getName()); + if (issuer.canSee(player)) { + players.add(player.getName()); + } } cachedCompletionValues.put("inPlot" + plot, players); }