public synchronized void checkForUpdates() {
boolean updatedResources = false;
// check if any resource the prototype knows about has changed or gone
for (Iterator i = trackers.values().iterator(); i.hasNext();) {
ResourceTracker tracker = (ResourceTracker) i.next();
try {
if (tracker.hasChanged()) {
updatedResources = true;
// let tracker know we've seen the update
tracker.markClean();
// if resource has gone remove it
if (!tracker.getResource().exists()) {
i.remove();
String name = tracker.getResource().getName();
if (name.endsWith(TypeManager.skinExtension)) {
skins.remove(tracker.getResource());
} else {
code.remove(tracker.getResource());
}
}
}
} catch (IOException iox) {
iox.printStackTrace();