implement flora populator

This commit is contained in:
dfsek committed 2021-07-14 07:30:22 -07:00
1 parent 7fa2e8251e
commit 7a38284158
6 files changed
+96 -9

No files matched your search

@@ -241,8 +241,9 @@ public class ConfigPackImpl implements ConfigPack {
CheckedRegistry registry = getCheckedRegistry(configType.getTypeClass());
for(AbstractConfiguration config : abstractConfigLoader.loadConfigs(configs.getOrDefault(configType, Collections.emptyList()))) {
try {
registry.register(config.getID(), ((ConfigFactory) configType.getFactory()).build(selfLoader.load(configType.getTemplate(this, main), config), main));
main.getEventManager().callEvent(new ConfigLoadEvent(this, config, template -> selfLoader.load(template, configuration), configType));
Object loaded = ((ConfigFactory) configType.getFactory()).build(selfLoader.load(configType.getTemplate(this, main), config), main);
registry.register(config.getID(), loaded);
main.getEventManager().callEvent(new ConfigLoadEvent(this, config, template -> selfLoader.load(template, configuration), configType, loaded));
} catch(DuplicateEntryException e) {
throw new LoadException("Duplicate registry entry: ", e);
}