2021-05-20 00:31:32 +02:00
|
|
|
--- a/net/minecraft/server/commands/CommandList.java
|
|
|
|
+++ b/net/minecraft/server/commands/CommandList.java
|
2023-06-07 17:30:00 +02:00
|
|
|
@@ -35,7 +35,14 @@
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private static int format(CommandListenerWrapper commandlistenerwrapper, Function<EntityPlayer, IChatBaseComponent> function) {
|
2021-05-20 00:31:32 +02:00
|
|
|
PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
|
2023-06-07 17:30:00 +02:00
|
|
|
- List<EntityPlayer> list = playerlist.getPlayers();
|
2021-05-20 00:31:32 +02:00
|
|
|
+ // CraftBukkit start
|
2023-06-07 17:30:00 +02:00
|
|
|
+ List<EntityPlayer> players = playerlist.getPlayers();
|
2021-05-20 00:31:32 +02:00
|
|
|
+ if (commandlistenerwrapper.getBukkitSender() instanceof org.bukkit.entity.Player) {
|
|
|
|
+ org.bukkit.entity.Player sender = (org.bukkit.entity.Player) commandlistenerwrapper.getBukkitSender();
|
2023-06-07 17:30:00 +02:00
|
|
|
+ players = players.stream().filter((ep) -> sender.canSee(ep.getBukkitEntity())).collect(java.util.stream.Collectors.toList());
|
2021-05-20 00:31:32 +02:00
|
|
|
+ }
|
2023-06-07 17:30:00 +02:00
|
|
|
+ List<EntityPlayer> list = players;
|
2021-05-20 00:31:32 +02:00
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
IChatBaseComponent ichatbasecomponent = ChatComponentUtils.formatList(list, function);
|
2021-05-20 00:31:32 +02:00
|
|
|
|
2023-06-07 17:30:00 +02:00
|
|
|
commandlistenerwrapper.sendSuccess(() -> {
|