IC2 Experimental API vs Code

  • Greetings:


    I have been trying to update my mod code to 1.6.4, and as part of that decided to upgrade my IC2 recipes to experimental.


    I have downloaded the code jar as well as the API jar (306 was the latest I checked), and have discovered that there is a rather nasty inconsistency in there.
    The addRecipe function in IMachineRecipeManager is different between the two versions.


    In the source API, the final parameter is an ItemStack...
    In the actual code, it is an ItemStack[].


    Attempting to add macerator recipes with this difference leads to a null pointer exception.


    I'll try ripping out the API from my code, and just link to the de-obf version in eclipse. Hopefully that will solve the problem for me.


    If someone on the dev team has the time it might be nice for the rest of us if the recipe API code could be updated to reflect the real codebase.


    I noticed several other reports of things not working with IC2 both here and elsewhere (Galacticraft, Mekanism). I know in Mekanisms case that their latest build does the have the correct recipe handler (it's what finally clued me in to compare the two). Perhaps other mods / modders difficulties are also from the combination of the two API functions.


    Thanks for your time.
    Schemm

  • The code you are referring is decompiled code, it isn't necessarily identical with the original source.


    The compiler replaces variable argument lists somefunction(type...) with an array somefunction(type[]) and calls to such a method somefunction(arg1, arg2, arg3) with somefunction(new type[] { arg1, arg2, arg3}).
    Once compiled both are identical, but the variable list one doesn't require building the argument array manually.


    You probably want to do something like Recipes.macerator.addRecipe(new RecipeInputItemStack(inputStack), null, outputStack).
    If your input is registered in the ore dictionary, you can also do Recipes.macerator.addRecipe(new RecipeInputOreDict("oreDictName"), null, outputStack).