From 8440092f32e543439cae7b3b1ebb7636b26e3dae Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 9 Feb 2014 14:03:03 -0500 Subject: [PATCH] Add support for fetching hidden players By: Tux --- .../bukkit/craftbukkit/entity/CraftPlayer.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 3518534daf..0bf8ced8aa 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2358,6 +2358,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { CraftPlayer.this.server.getServer().getPlayerList().respawn( CraftPlayer.this.getHandle(), false, Entity.RemovalReason.KILLED, org.bukkit.event.player.PlayerRespawnEvent.RespawnReason.PLUGIN ); } } + + @Override + public Set getHiddenPlayers() + { + Set ret = new HashSet<>(); + for ( Player p : CraftPlayer.this.getServer().getOnlinePlayers() ) + { + if ( !CraftPlayer.this.canSee(p) ) + { + ret.add( p ); + } + } + + return java.util.Collections.unmodifiableSet( ret ); + } }; public Player.Spigot spigot()