Skip to content

Commit

Permalink
fix canSee check
Browse files Browse the repository at this point in the history
  • Loading branch information
Badbird5907 committed Apr 6, 2024
1 parent 3d314f8 commit 10959f1
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ public static List<String> suggest(CoreCommandSender s) {
BukkitCommandSenderImpl sender = (BukkitCommandSenderImpl) s;
if (sender.isPlayer()) {
Player p = sender.getPlayer();
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (p.canSee(onlinePlayer)) {
list.add(playerNameFunction.apply(onlinePlayer));
}
}
Bukkit.getOnlinePlayers().stream().filter(p::canSee).forEach(onlinePlayer -> list.add(playerNameFunction.apply(onlinePlayer)));
} else {
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
list.add(playerNameFunction.apply(onlinePlayer));
Expand Down

0 comments on commit 10959f1

Please sign in to comment.