remove registry provider from ConfigType

This commit is contained in:
dfsek
2021-12-16 22:12:42 -07:00
parent 011a915d38
commit 0ad3867a91
2 changed files with 1 additions and 5 deletions

View File

@@ -15,10 +15,6 @@ import com.dfsek.terra.api.util.reflection.TypeKey;
public interface ConfigType<T extends AbstractableTemplate, R> {
default Supplier<OpenRegistry<R>> registrySupplier(ConfigPack pack) {
return pack.getRegistryFactory()::create;
}
T getTemplate(ConfigPack pack, Platform platform);
ConfigFactory<T, R> getFactory();

View File

@@ -375,7 +375,7 @@ public class ConfigPackImpl implements ConfigPack {
if(!registryMap
.containsKey(value.getTypeKey()
.getType())) {
OpenRegistry<?> openRegistry = value.registrySupplier(ConfigPackImpl.this).get();
OpenRegistry<?> openRegistry = new OpenRegistryImpl<>();
selfLoader.registerLoader(value.getTypeKey().getType(), openRegistry);
abstractConfigLoader.registerLoader(value.getTypeKey().getType(), openRegistry);
registryMap.put(value.getTypeKey().getType(), new CheckedRegistryImpl<>(openRegistry));