Set<String> difference = Sets.newLinkedHashSet(Sets.difference(localModIds, remoteModIds));
for (Iterator<String> iterator = difference.iterator(); iterator.hasNext();)
{
String missingRemotely = iterator.next();
ModState modState = modController.getModState(namedMods.get(missingRemotely));
if (modState == ModState.DISABLED)
{
iterator.remove();
}
}