@Override
    public void update() {
        if (!transmitting) {
            super.update();

            boolean resourcesUpdated = false;
            Resource resource = null;
            ArrayList dirtyResources = new ArrayList();

            try {
                for (String key : resources.keySet()) {
                    resource = (Resource) resources.get(key);
                    if (resource != null) {
                        resource.update();

                        if (resource.isDirty()) {
                            dirtyResources.add(key);
                        }
                    }
                }
            } catch (ConcurrentModificationException concEx) {
                //another thread was trying to modify resources while iterating
                //we'll continue and the new item can be grabbed on the next update
            }

            if (dirtyResources.size() > 0) {
                resourcesUpdated = true;
                for (int i = 0; i < dirtyResources.size(); i++) {
                    resources.remove((String) dirtyResources.get(i));
                }
            }

            if (resourcesUpdated && gameController.multiplayerMode != gameController.multiplayerMode.CLIENT) {
                checkResources();
            }
        }
    }