mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
43702a9e10
By: md_5 <git@md-5.net>
15 lines
1.1 KiB
Diff
15 lines
1.1 KiB
Diff
--- a/net/minecraft/server/commands/CommandList.java
|
|
+++ b/net/minecraft/server/commands/CommandList.java
|
|
@@ -37,6 +37,12 @@
|
|
private static int format(CommandListenerWrapper commandlistenerwrapper, Function<EntityPlayer, IChatBaseComponent> function) {
|
|
PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
|
|
List<EntityPlayer> list = playerlist.getPlayers();
|
|
+ // CraftBukkit start
|
|
+ if (commandlistenerwrapper.getBukkitSender() instanceof org.bukkit.entity.Player) {
|
|
+ org.bukkit.entity.Player sender = (org.bukkit.entity.Player) commandlistenerwrapper.getBukkitSender();
|
|
+ list = list.stream().filter((ep) -> sender.canSee(ep.getBukkitEntity())).collect(java.util.stream.Collectors.toList());
|
|
+ }
|
|
+ // CraftBukkit end
|
|
IChatBaseComponent ichatbasecomponent = ChatComponentUtils.formatList(list, function);
|
|
|
|
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.list.players", new Object[]{list.size(), playerlist.getMaxPlayers(), ichatbasecomponent}), false);
|