mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 16:35:50 +00:00
fix addon registry stack overflow
This commit is contained in:
parent
27a54101e7
commit
fe28fcedd1
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,10 @@ public class PaletteConfigType implements ConfigType<PaletteTemplate, Palette> {
|
||||
return () -> pack.getRegistryFactory().create(registry -> (TypeLoader<Palette>) (t, c, loader) -> {
|
||||
if(((String) c).startsWith("BLOCK:"))
|
||||
return new PaletteImpl.Singleton(main.getWorldHandle().createBlockData(((String) c).substring(6))); // Return single palette for BLOCK: shortcut.
|
||||
return registry.load(t, c, loader);
|
||||
Palette obj = registry.get((String) c);
|
||||
if(obj == null)
|
||||
throw new LoadException("No such " + t.getTypeName() + " matching \"" + c + "\" was found in this registry.");
|
||||
return obj;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user