Add support for fetching hidden players

By: Tux <write@imaginarycode.com>
This commit is contained in:
CraftBukkit/Spigot 2014-02-09 14:03:03 -05:00
parent c3ce457c08
commit 8440092f32

View file

@ -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<Player> getHiddenPlayers()
{
Set<Player> 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()