mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
Make Vanilla /list respect Vanish API
By: md_5 <git@md-5.net>
This commit is contained in:
parent
097e647d7a
commit
9111166484
1 changed files with 15 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
--- a/net/minecraft/server/commands/CommandList.java
|
||||
+++ b/net/minecraft/server/commands/CommandList.java
|
||||
@@ -36,6 +36,12 @@
|
||||
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
|
||||
IChatMutableComponent ichatmutablecomponent = ChatComponentUtils.b(list, function);
|
||||
|
||||
commandlistenerwrapper.sendMessage(new ChatMessage("commands.list.players", new Object[]{list.size(), playerlist.getMaxPlayers(), ichatmutablecomponent}), false);
|
Loading…
Reference in a new issue