mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
registry injection
This commit is contained in:
@@ -481,6 +481,18 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
||||
} catch(ConfigException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(template.doRegistryInjection()) {
|
||||
BuiltinRegistries.CONFIGURED_FEATURE.getEntries().forEach(entry -> {
|
||||
if(!template.getExcludedRegistryFeatures().contains(entry.getKey().getValue())) {
|
||||
try {
|
||||
event.getPack().getTreeRegistry().add(entry.getKey().getValue().toString(), (Tree) entry.getValue());
|
||||
main.logger().info("Injected ConfiguredFeature " + entry.getKey().getValue() + " as Tree.");
|
||||
} catch(DuplicateEntryException ignored) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
templates.put(event.getPack(), template);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user