// Prefabs that still need to be created, by their name
Map<String, EntityData.Prefab> pendingPrefabs = Maps.newHashMap();
for (EntityData.Prefab prefabData : globalStore.getPrefabList()) {
if (!prefabManager.exists(prefabData.getName())) {
if (!prefabData.hasParentName()) {
Module module = environment.get(new SimpleUri(prefabData.getName()).getModuleName());
try (ModuleContext.ContextSpan ignored = ModuleContext.setContext(module)) {
createPrefab(prefabData);
} catch (Exception e) {
logger.error("Failed to load prefab {}", prefabData.getName(), e);
}