public void stopNPCGather(Player p) {
        if (registry.getGameController().multiplayerMode != registry.getGameController().multiplayerMode.CLIENT) {
            Resource resource = null;
            try {
                for (String key : resources.keySet()) {
                    resource = (Resource) resources.get(key);
                    if (resource != null) {
                        if (resource.getIsCollecting()) {
                            if (resource.getCollectingPlayer() == p && resource.isNPCCollecting()) {
                                resource.setCollecting(p, false);
                                collectingResources.remove(resource.getId());
                            }
                        }
                    }
                }
            } 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
            }
        }
    }