Simply put, I have the following code, is there any better way to do this?
Also, I cannot modify any of the recipe classes.
public static ShapelessRecursiveRecipe convertRecipe(Object o)
{
//might be a better way to do this
if(o instanceof ShapedRecipes)
return new ShapelessRecursiveRecipe((ShapedRecipes)o);
else if(o instanceof ShapelessRecipes)
return new ShapelessRecursiveRecipe((ShapelessRecipes)o);
else if(o instanceof ShapedOreRecipe)
return new ShapelessRecursiveRecipe((ShapedOreRecipe)o);
else if(o instanceof ShapelessOreRecipe)
return new ShapelessRecursiveRecipe((ShapelessOreRecipe)o);
else
return null;
}