/FileExtraction/Java_unseen/Wind-Development_WindSpigot/WindSpigot-Server/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java
package org.bukkit.craftbukkit.util;

import java.util.HashSet;
import java.util.List;

import org.bukkit.entity.Player;

import net.minecraft.server.EntityPlayer;
import net.minecraft.server.MinecraftServer;

public class LazyPlayerSet extends LazyHashSet<Player> {

	@Override
	HashSet<Player> makeReference() {
		if (reference != null) {
			throw new IllegalStateException("Reference already created!");
		}
		List<EntityPlayer> players = MinecraftServer.getServer().getPlayerList().players;
		HashSet<Player> reference = new HashSet<Player>(players.size());
		for (EntityPlayer player : players) {
			reference.add(player.getBukkitEntity());
		}
		return reference;
	}

}
