dont use pack instance where unneeded

This commit is contained in:
dfsek
2021-07-20 15:12:06 -07:00
parent d807abb165
commit 0ff6a9cce1
10 changed files with 11 additions and 29 deletions

View File

@@ -191,7 +191,7 @@ public class ConfigPackImpl implements ConfigPack {
@SuppressWarnings("unchecked")
private ConfigTypeRegistry createRegistry() {
return new ConfigTypeRegistry(main, (id, configType) -> {
OpenRegistry<?> openRegistry = configType.registrySupplier().get();
OpenRegistry<?> openRegistry = configType.registrySupplier(this).get();
if(registryMap.containsKey(configType.getTypeClass().getType())) { // Someone already registered something; we need to copy things to the new registry.
registryMap.get(configType.getTypeClass().getType()).getLeft().forEach(((OpenRegistry<Object>) openRegistry)::register);
}