use of com.mcmoddev.orespawn.api.IFeature in project OreSpawn by MinecraftModDevelopmentMods.
the class FeatureRegistry method getInstance.
private static IFeature getInstance(String className) {
Class<?> featureClazz;
Constructor<?> featureCons;
IFeature feature;
try {
featureClazz = Class.forName(className);
featureCons = featureClazz.getConstructor();
feature = (IFeature) featureCons.newInstance();
} catch (Exception e) {
CrashReport report = CrashReport.makeCrashReport(e, "Failed to load and instantiate an instance of the feature generator named " + className + " that was specified as a feature generator");
report.getCategory().addCrashSection(ORE_SPAWN_VERSION, Constants.VERSION);
OreSpawn.LOGGER.info(report.getCompleteReport());
return null;
}
return feature;
}
Aggregations