Fix minor loading issue

This commit is contained in:
dfsek
2020-12-04 21:34:48 -07:00
parent 3d12af6b21
commit 7db75ab21b

View File

@@ -114,9 +114,7 @@ public class ConfigPack {
throw new FileMissingException("No pack.yml file found in " + folder.getAbsolutePath(), e);
}
load(new FolderLoader(folder.toPath()));
LangUtil.log("config-pack.loaded", Level.INFO, template.getID(), String.valueOf((System.nanoTime() - l) / 1000000D), template.getAuthor(), template.getVersion());
load(new FolderLoader(folder.toPath()), l);
}
public ConfigPack(ZipFile file) throws ConfigException {
@@ -137,11 +135,10 @@ public class ConfigPack {
selfLoader.load(template, stream);
load(new ZIPLoader(file));
LangUtil.log("config-pack.loaded", Level.INFO, template.getID(), String.valueOf((System.nanoTime() - l) / 1000000D));
load(new ZIPLoader(file), l);
}
private void load(Loader loader) throws ConfigException {
private void load(Loader loader, long start) throws ConfigException {
for(Map.Entry<String, Double> var : template.getVariables().entrySet()) {
varScope.create(var.getKey()).setValue(var.getValue());
}
@@ -164,6 +161,8 @@ public class ConfigPack {
}
}
template.getStructureLocatables().forEach((type, name) -> structureMap.put(Objects.requireNonNull(type), Objects.requireNonNull(structureRegistry.get(name))));
LangUtil.log("config-pack.loaded", Level.INFO, template.getID(), String.valueOf((System.nanoTime() - start) / 1000000D), template.getAuthor(), template.getVersion());
}
private <C extends AbstractableTemplate, O> void buildAll(TerraFactory<C, O> factory, TerraRegistry<O> registry, List<C> configTemplates) throws LoadException {