2021-05-20 00:31:32 +02:00
|
|
|
--- a/net/minecraft/server/commands/CommandList.java
|
|
|
|
+++ b/net/minecraft/server/commands/CommandList.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -37,6 +37,12 @@
|
2021-05-20 00:31:32 +02:00
|
|
|
private static int a(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
|
2021-06-11 07:00:00 +02:00
|
|
|
IChatBaseComponent ichatbasecomponent = ChatComponentUtils.b(list, function);
|
2021-05-20 00:31:32 +02:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
commandlistenerwrapper.sendMessage(new ChatMessage("commands.list.players", new Object[]{list.size(), playerlist.getMaxPlayers(), ichatbasecomponent}), false);
|