[SOLVED] IC2 API - Add Recipe crash

  • Greetings fellow earthlings,

    So I am in a little bit of a pickle. I am trying to add a new recipe to the macerator. Simple enough right?

    Looking though code and examples I have managed to extract this super simple line of code

    Code
    Recipes.macerator.addRecipe(InputItemStackHere, OutputItemStackHere)

    Before using this code I could not place my InputItemStack into the top slot of the macerator. After, I can. Expect with a 'little' problem:

    Display Spoiler
    Code
    java.lang.NullPointerException	at ic2.core.BasicMachineRecipeManager.getOutputFor(BasicMachineRecipeManager.java:28)	at ic2.core.block.invslot.InvSlotProcessableGeneric.accepts(InvSlotProcessableGeneric.java:22)	at ic2.core.slot.SlotInvSlot.isItemValid(SlotInvSlot.java:19)	at net.minecraft.client.gui.inventory.GuiContainer.mouseClickMove(GuiContainer.java:622)	at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:223)	at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:176)	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1554)	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:898)	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)	at net.minecraft.client.main.Main.main(Main.java:93)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:597)	at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)	at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
    
    
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:---------------------------------------------------------------------------------------
    -- Head --Stacktrace:	at ic2.core.BasicMachineRecipeManager.getOutputFor(BasicMachineRecipeManager.java:28)	at ic2.core.block.invslot.InvSlotProcessableGeneric.accepts(InvSlotProcessableGeneric.java:22)	at ic2.core.slot.SlotInvSlot.isItemValid(SlotInvSlot.java:19)	at net.minecraft.client.gui.inventory.GuiContainer.mouseClickMove(GuiContainer.java:622)	at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:223)	at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:176)
    -- Affected screen --Details:	Screen name: ic2.core.block.machine.gui.GuiMacerator

    Is there something I am missing from my code? Or is this a bug?

    So ya. Thats 'bout it.

    Edited once, last by AGKz: Solved problem (August 16, 2013 at 5:37 PM).

  • Hello, I am developing a small mod that adds some useful recipes in minecraft, but I do not know how we report the second parameter of macerator.addRecipe(new ic2.api.recipe.RecipeInputItemStack(new ItemStack(1,1,0)), ???, new ItemStack(13,1,0));, which is the type NBTTagCompound.

    Translated in Google from pt-br to en-us.