Java Code Examples for org.bukkit.Bukkit#getOfflinePlayers()

The following examples show how to use org.bukkit.Bukkit#getOfflinePlayers() . 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: AdminCommand.java    From civcraft with GNU General Public License v2.0 5 votes vote down vote up
public void playerreport_cmd() {

	LinkedList<OfflinePlayer> offplayers = new LinkedList<OfflinePlayer>();
	for (OfflinePlayer offplayer : Bukkit.getOfflinePlayers()) {
		offplayers.add(offplayer);
	}
	
	CivMessage.sendHeading(sender, "Players with Goodies");
	CivMessage.send(sender, "Processing (this may take a while)");
	TaskMaster.syncTask(new ReportPlayerInventoryTask(sender, offplayers), 0);
}
 
Example 2
Source File: VAuthConverter.java    From AuthMeReloaded with GNU General Public License v3.0 5 votes vote down vote up
private String getName(UUID uuid) {
    for (OfflinePlayer op : Bukkit.getOfflinePlayers()) {
        if (op.getUniqueId().compareTo(uuid) == 0) {
            return op.getName();
        }
    }
    return null;
}
 
Example 3
Source File: Players.java    From helper with MIT License 4 votes vote down vote up
public static void forEachOffline(Consumer<OfflinePlayer> consumer) {
    for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
        consumer.accept(player);
    }
}
 
Example 4
Source File: ExprOfflinePlayers.java    From Skript with GNU General Public License v3.0 4 votes vote down vote up
@Override
@Nullable
protected OfflinePlayer[] get(final Event event) {
	return Bukkit.getOfflinePlayers();
}
 
Example 5
Source File: Crate.java    From CratesPlus with GNU General Public License v3.0 4 votes vote down vote up
public void giveAllOffline(Integer amount) {
    for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
        give(player, amount);
    }
}
 
Example 6
Source File: BukkitService.java    From AuthMeReloaded with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets every player that has ever played on this server.
 *
 * @return an array containing all previous players
 */
public OfflinePlayer[] getOfflinePlayers() {
    return Bukkit.getOfflinePlayers();
}