fix addon registry stack overflow

This commit is contained in:
dfsek
2021-07-05 19:47:02 -07:00
parent 27a54101e7
commit fe28fcedd1
2 changed files with 8 additions and 2 deletions

View File

@@ -41,7 +41,10 @@ public class BiomeConfigType implements ConfigType<BiomeTemplate, BiomeBuilder>
public Supplier<OpenRegistry<BiomeBuilder>> registrySupplier() {
return () -> pack.getRegistryFactory().create(registry -> (TypeLoader<BiomeBuilder>) (t, c, loader) -> {
if(c.equals("SELF")) return null;
return registry.load(t, c, loader);
BiomeBuilder obj = registry.get((String) c);
if(obj == null)
throw new LoadException("No such " + t.getTypeName() + " matching \"" + c + "\" was found in this registry.");
return obj;
});
}
}