mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 22:43:14 +01:00
Add support for fetching hidden players
By: Tux <write@imaginarycode.com>
This commit is contained in:
parent
c3ce457c08
commit
8440092f32
1 changed files with 15 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue