mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-22 16:17:20 +00:00
implement flora populator
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user