IC2 Having Trouble adding extractor recipe

  • So I've been in modding for a while now but recently I decided to make and IC2 addon and I wanted to add an extractor recipe but whenever I try I get some weird error about ItemStack not being allowed to be used with newRecipe.Extractor So can you check this code out and tell me what I did wrong.


    Java
    package ic2addon;
    import java.util.Map;
    import net.minecraft.item.ItemStack;import ic2.api.item.Items;import ic2.api.recipe.Recipes;import cpw.mods.fml.common.event.FMLInitializationEvent;
    public class NonsenseRecipe {		public void load(FMLInitializationEvent event){		ItemStack circuit = Items.getItem("electronicCircuit");		ItemStack clock = Items.getItem("pocketSundial");				Recipes.extractor.addRecipe(clock, circuit);			}
    }


    The Error Is :
    The method addRecipe(IRecipeInput, NBTTagCmpound, ItemStack...) in the type IMachineRecipeManager is not applicable for the arguements (ItemStack, ItemStack)


    Isn't this is how it used to work?

  • A lot of things changed and still change in the Experimental API, since a lot of things changed and still change in Experimental IC². The valid recipe would be:


    Code
    Recipes.extractor.addRecipe(new IRecipeInput(clock), null, circuit);


    Also, glad you use AGKz's tutorials. They are a bit outdated, but still very helpful, can only recommend. In case you still have questions, maybe you wanna take a look at Unidye's (or any other IC² Addon's that's available) code. :)

  • With this I have no idea what I'm doing wrong.


    The recipe just doesn't work.

  • The code to add the recipe itself is correct, so let's go through some other things..


    Is that the main class of your mod? If so, it should actually work. is missing stuff.
    If not, are you actually calling the method load()?


    Which version of forge and IC² api are you using?
    Does it just not work or do you get some kind of message / exception in the log? Are you sure you are looking for the recipe correctly?


    EDIT: yeah, mak is right, derp.

  • You're missing @Mod annotation on your main mod class.
    You're missing @EventHandler annotation on your load() method.


    Fix that and it'll work. Or it won't, nobody caresknows.