Source:
public Optional<Entity> createEntity(EntityType type, Vector3d position, boolean naturally) { checkNotNull(type, "The entity type cannot be null!"); checkNotNull(position, "The position cannot be null!"); Entity entity = null; Class<? extends Entity> entityClass = type.getEntityClass(); double x = position.getX(); double y = position.getY(); double z = position.getZ(); if (entityClass.isAssignableFrom(EntityPlayerMP.class) || entityClass.isAssignableFrom(EntityDragonPart.class)) { return Optional.empty(); } net.minecraft.world.World world = (net.minecraft.world.World) (Object) this; if (entityClass.isAssignableFrom(EntityLightningBolt.class)) { entity = (Entity) new EntityLightningBolt(world, x, y, z, false); } else if (entityClass.isAssignableFrom(EntityEnderPearl.class)) { EntityArmorStand tempEntity = new EntityArmorStand(world, x, y, z); tempEntity.posY -= tempEntity.getEyeHeight(); entity = (Entity) new EntityEnderPearl(world, tempEntity); ((EnderPearl) entity).setShooter(ProjectileSource.UNKNOWN); } if (entityClass.isAssignableFrom(EntityFallingBlock.class)) { entity = (Entity) new EntityFallingBlock(world, x, y, z, Blocks.SAND.getDefaultState()); } else if (entityClass.isAssignableFrom(EntityItem.class)) { entity = (Entity) new EntityItem(world, x, y, z, new ItemStack(Blocks.STONE)); } if (entity == null) { try { entity = ConstructorUtils.invokeConstructor(entityClass, this); ((net.minecraft.entity.Entity) entity).setPosition(x, y, z); } catch (Exception e) { SpongeImpl.getLogger().error(ExceptionUtils.getStackTrace(e)); } } if (naturally && entity instanceof EntityLiving) { ((EntityLiving)entity).onInitialSpawn(world.getDifficultyForLocation(new BlockPos((net.minecraft.entity.Entity) entity)), null); } if (entity instanceof EntityPainting) { ((EntityPainting) entity).art = EnumArt.KEBAB; } return Optional.ofNullable(entity); }

Target:
private Optional<Entity> createEntity(EntityType type, Vector3d position, boolean naturally) { checkNotNull(type, "The entity type cannot be null!"); checkNotNull(position, "The position cannot be null!"); Entity entity = null; Class<? extends Entity> entityClass = type.getEntityClass(); double x = position.getX(); double y = position.getY(); double z = position.getZ(); if (entityClass.isAssignableFrom(EntityPlayerMP.class) || entityClass.isAssignableFrom(EntityDragonPart.class)) { return Optional.empty(); } net.minecraft.world.World world = (net.minecraft.world.World) (Object) this; if (entityClass.isAssignableFrom(EntityLightningBolt.class)) { entity = (Entity) new EntityLightningBolt(world, x, y, z, false); } else if (entityClass.isAssignableFrom(EntityEnderPearl.class)) { EntityArmorStand tempEntity = new EntityArmorStand(world, x, y, z); tempEntity.posY -= tempEntity.getEyeHeight(); entity = (Entity) new EntityEnderPearl(world, tempEntity); ((EnderPearl) entity).setShooter(ProjectileSource.UNKNOWN); } if (entityClass.isAssignableFrom(EntityFallingBlock.class)) { entity = (Entity) new EntityFallingBlock(world, x, y, z, Blocks.SAND.getDefaultState()); } else if (entityClass.isAssignableFrom(EntityItem.class)) { entity = (Entity) new EntityItem(world, x, y, z, new ItemStack(Blocks.STONE)); } if (entity == null) { try { entity = ConstructorUtils.invokeConstructor(entityClass, this); ((net.minecraft.entity.Entity) entity).setPosition(x, y, z); } catch (Exception e) { SpongeImpl.getLogger().error(ExceptionUtils.getStackTrace(e)); } } if (naturally && entity instanceof EntityLiving) { ((EntityLiving)entity).onInitialSpawn(world.getDifficultyForLocation(new BlockPos((net.minecraft.entity.Entity) entity)), null); } if (entity instanceof EntityPainting) { ((EntityPainting) entity).art = EnumArt.KEBAB; } return Optional.ofNullable(entity); }