Search in sources :

Example 1 with SpongePlayer

use of com.viaversion.viaversion.sponge.commands.SpongePlayer in project ViaVersion by ViaVersion.

the class SpongePlugin method getOnlinePlayers.

@Override
public ViaCommandSender[] getOnlinePlayers() {
    Collection<ServerPlayer> players = game.server().onlinePlayers();
    ViaCommandSender[] array = new ViaCommandSender[players.size()];
    int i = 0;
    for (ServerPlayer player : players) {
        array[i++] = new SpongePlayer(player);
    }
    return array;
}
Also used : ViaCommandSender(com.viaversion.viaversion.api.command.ViaCommandSender) SpongePlayer(com.viaversion.viaversion.sponge.commands.SpongePlayer) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer)

Aggregations

ViaCommandSender (com.viaversion.viaversion.api.command.ViaCommandSender)1 SpongePlayer (com.viaversion.viaversion.sponge.commands.SpongePlayer)1 ServerPlayer (org.spongepowered.api.entity.living.player.server.ServerPlayer)1