mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
registry injection
This commit is contained in:
@@ -481,6 +481,18 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
} catch(ConfigException e) {
|
} catch(ConfigException e) {
|
||||||
e.printStackTrace();
|
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);
|
templates.put(event.getPack(), template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user