Java Code Examples for com.velocitypowered.api.proxy.Player#isActive()
The following examples show how to use
com.velocitypowered.api.proxy.Player#isActive() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VelocityBossBar.java From Velocity with MIT License | 5 votes |
@Override public void addPlayer(Player player) { checkNotNull(player, "player"); if (!players.contains(player)) { players.add(player); } if (player.isActive() && visible) { sendPacket(player, addPacket()); } }
Example 2
Source File: VelocityBossBar.java From Velocity with MIT License | 5 votes |
@Override public void removePlayer(Player player) { checkNotNull(player, "player"); players.remove(player); if (player.isActive()) { sendPacket(player, removePacket()); } }
Example 3
Source File: VelocityBossBar.java From Velocity with MIT License | 5 votes |
private void sendToAffected(MinecraftPacket packet) { for (Player player : players) { if (player.isActive() && player.getProtocolVersion().getProtocol() >= ProtocolVersion.MINECRAFT_1_9.getProtocol()) { sendPacket(player, packet); } } }
Example 4
Source File: LPVelocityBootstrap.java From LuckPerms with MIT License | 4 votes |
@Override public boolean isPlayerOnline(UUID uniqueId) { Player player = this.proxy.getPlayer(uniqueId).orElse(null); return player != null && player.isActive(); }