aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/server/commands/CommandList.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/server/commands/CommandList.patch')
-rw-r--r--patch-remap/og/net/minecraft/server/commands/CommandList.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/server/commands/CommandList.patch b/patch-remap/og/net/minecraft/server/commands/CommandList.patch
new file mode 100644
index 0000000000..dbd943ac63
--- /dev/null
+++ b/patch-remap/og/net/minecraft/server/commands/CommandList.patch
@@ -0,0 +1,18 @@
+--- a/net/minecraft/server/commands/CommandList.java
++++ b/net/minecraft/server/commands/CommandList.java
+@@ -35,7 +35,14 @@
+
+ private static int format(CommandListenerWrapper commandlistenerwrapper, Function<EntityPlayer, IChatBaseComponent> function) {
+ PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
+- List<EntityPlayer> list = playerlist.getPlayers();
++ // CraftBukkit start
++ List<EntityPlayer> players = playerlist.getPlayers();
++ if (commandlistenerwrapper.getBukkitSender() instanceof org.bukkit.entity.Player) {
++ org.bukkit.entity.Player sender = (org.bukkit.entity.Player) commandlistenerwrapper.getBukkitSender();
++ players = players.stream().filter((ep) -> sender.canSee(ep.getBukkitEntity())).collect(java.util.stream.Collectors.toList());
++ }
++ List<EntityPlayer> list = players;
++ // CraftBukkit end
+ IChatBaseComponent ichatbasecomponent = ChatComponentUtils.formatList(list, function);
+
+ commandlistenerwrapper.sendSuccess(() -> {