LinkedList<Thread> urlThreads = new LinkedList<Thread>();
Iterator<Entry<Plugin, List<String>>> j = preLoginUrlCache.entrySet().iterator();
while (j.hasNext()) {
final Entry<Plugin, List<String>> next = j.next();
for (final String url : next.getValue()) {
URLCheck urlCheck = new URLCheck(url, new byte[4096], new CRCStoreRunnable() {
Long CRC;
public void setCRC(Long CRC) {
this.CRC = CRC;
}
public void run() {
player.sendPacket(new PacketPreCacheFile(next.getKey().getDescription().getName(), url, CRC, true));
}
});
urlCheck.setName(url);
urlCheck.start();
urlThreads.add(urlCheck);
}
}
new URLCheckJoin(urlThreads, player).start();
}