Search in sources :

Example 6 with SchematicEntity

use of buildcraft.api.blueprints.SchematicEntity in project BuildCraft by BuildCraft.

the class SchematicRegistry method createSchematicEntity.

public SchematicEntity createSchematicEntity(Class<? extends Entity> entityClass) {
    if (!schematicEntities.containsKey(entityClass)) {
        return null;
    }
    try {
        SchematicConstructor c = schematicEntities.get(entityClass);
        SchematicEntity s = (SchematicEntity) c.newInstance();
        s.entity = entityClass;
        return s;
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    }
    return null;
}
Also used : SchematicEntity(buildcraft.api.blueprints.SchematicEntity) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

SchematicEntity (buildcraft.api.blueprints.SchematicEntity)6 BlockPos (net.minecraft.util.math.BlockPos)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 NBTTagList (net.minecraft.nbt.NBTTagList)2 MappingNotFoundException (buildcraft.api.blueprints.MappingNotFoundException)1 SchematicBlock (buildcraft.api.blueprints.SchematicBlock)1 SchematicBlockBase (buildcraft.api.blueprints.SchematicBlockBase)1 BuildingSlotBlock (buildcraft.core.builders.BuildingSlotBlock)1 BuildingSlotEntity (buildcraft.core.builders.BuildingSlotEntity)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 LinkedList (java.util.LinkedList)1 CrashReport (net.minecraft.crash.CrashReport)1 CrashReportCategory (net.minecraft.crash.CrashReportCategory)1 Entity (net.minecraft.entity.Entity)1 NBTBase (net.minecraft.nbt.NBTBase)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ReportedException (net.minecraft.util.ReportedException)1 Vec3d (net.minecraft.util.math.Vec3d)1