Search in sources :

Example 1 with IFeature

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;
}
Also used : CrashReport(net.minecraft.crash.CrashReport) IFeature(com.mcmoddev.orespawn.api.IFeature) IOException(java.io.IOException)

Aggregations

IFeature (com.mcmoddev.orespawn.api.IFeature)1 IOException (java.io.IOException)1 CrashReport (net.minecraft.crash.CrashReport)1