+ /*!
+ * Notifies the registered NodeResolver instances that node registration
+ * has finished, then unregisters all listeners.
+ * Must be called after node registration has finished!
+ */
+ void runNodeResolveCallbacks();
+
+ /*!
+ * Sets the registration completion flag to false and unregisters all
+ * NodeResolver instances listening to the manager.
+ */
+ void resetNodeResolveState();
+
+ /*!
+ * Resolves (caches the IDs) cross-references between nodes,
+ * like liquid alternatives.
+ * Must be called after node registration has finished!
+ */
+ void resolveCrossrefs();
+
+private:
+ /*!
+ * Resets the manager to its initial state.
+ * See the documentation of the constructor.
+ */
+ void clear();
+
+ /*!
+ * Allocates a new content ID, and returns it.
+ * @return the allocated ID or \ref CONTENT_IGNORE if could not allocate
+ */
+ content_t allocateId();
+
+ /*!
+ * Binds the given content ID and node name.
+ * Registers them in \ref m_name_id_mapping and
+ * \ref m_name_id_mapping_with_aliases.
+ * @param i a content ID
+ * @param name a node name
+ */
+ void addNameIdMapping(content_t i, const std::string &name);
+
+ /*!
+ * Removes a content ID from all groups.
+ * Erases content IDs from vectors in \ref m_group_to_items and
+ * removes empty vectors.
+ * @param id Content ID
+ */
+ void eraseIdFromGroups(content_t id);
+
+ /*!
+ * Recalculates m_selection_box_int_union based on
+ * m_selection_box_union.
+ */
+ void fixSelectionBoxIntUnion();
+
+ //! Features indexed by ID.
+ std::vector<ContentFeatures> m_content_features;
+
+ //! A mapping for fast conversion between names and IDs
+ NameIdMapping m_name_id_mapping;
+
+ /*!
+ * Like @ref m_name_id_mapping, but maps only from names to IDs, and
+ * includes aliases too. Updated by \ref updateAliases().
+ * Note: Not serialized.
+ */
+ std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
+
+ /*!
+ * A mapping from group names to a vector of content types that belong
+ * to it. Necessary for a direct lookup in \ref getIds().
+ * Note: Not serialized.
+ */
+ std::unordered_map<std::string, std::vector<content_t>> m_group_to_items;
+
+ /*!
+ * The next ID that might be free to allocate.
+ * It can be allocated already, because \ref CONTENT_AIR,
+ * \ref CONTENT_UNKNOWN and \ref CONTENT_IGNORE are registered when the
+ * manager is initialized, and new IDs are allocated from 0.
+ */
+ content_t m_next_id;
+
+ //! True if all nodes have been registered.
+ bool m_node_registration_complete;
+
+ /*!
+ * The union of all nodes' selection boxes.
+ * Might be larger if big nodes are removed from the manager.
+ */
+ aabb3f m_selection_box_union;
+
+ /*!
+ * The smallest box in integer node coordinates that
+ * contains all nodes' selection boxes.
+ * Might be larger if big nodes are removed from the manager.
+ */
+ core::aabbox3d<s16> m_selection_box_int_union;
+
+ /*!
+ * NodeResolver instances to notify once node registration has finished.
+ * Even constant NodeDefManager instances can register listeners.
+ */
+ mutable std::vector<NodeResolver *> m_pending_resolve_callbacks;