IC2 API Help (Experimental)

  • Hello,


    I am having some trouble working out how to use the API for the machines I have worked out the main machines recipes but I am having some difficulty working out how to add a Thermal Centrifuge recipes. This is what I have (And believe to be right) But according to eclipse I am doing it wrong :/


    Code
    Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(Block.sand)), new NBTTagCompound("minHeat", 1-1), new ItemStack(ModBlocks.BlockPolishedGlass, 2));


    If anyone can help that would be most appreciated.


    Thanks,
    artdude543

    • Official Post

    It doesn't work that way, you are naming the compound tag instead of adding a property. Use this:


    NBTTagCompound metadata = new NBTTagCompound();
    metadata.setInteger("minHeat", <your heat value>);
    Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(Block.sand)), metadata, new ItemStack(ModBlocks.BlockPolishedGlass, 2));