+ }
+ assert(id != CONTENT_IGNORE);
+ addNameIdMapping(id, name);
+ }
+ m_content_features[id] = def;
+ verbosestream<<"NodeDefManager: registering content id \""<<id
+ <<"\": name=\""<<def.name<<"\""<<std::endl;
+
+ // Add this content to the list of all groups it belongs to
+ // FIXME: This should remove a node from groups it no longer
+ // belongs to when a node is re-registered
+ for (ItemGroupList::const_iterator i = def.groups.begin();
+ i != def.groups.end(); ++i) {
+ std::string group_name = i->first;
+
+ std::map<std::string, GroupItems>::iterator
+ j = m_group_to_items.find(group_name);
+ if (j == m_group_to_items.end()) {
+ m_group_to_items[group_name].push_back(
+ std::make_pair(id, i->second));
+ } else {
+ GroupItems &items = j->second;
+ items.push_back(std::make_pair(id, i->second));
+ }