1. Forum
  2. Wiki
  3. Bugtracker
  4. Blog
  5. Members
    1. Recent Activities
    2. Users Online
    3. Team
    4. Search Members
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Forum
  • Pages
  • More Options
  1. IC² Forum
  2. Forum
  3. Archive
  4. IndustrialCraft²
IC2 Experimental builds (jenkins):
v2.0/2.1/2.2 / 2.3 / 2.5 / 2.6 / 2.7 / 2.8 (For Minecraft 1.6.4/1.7.2/1.7.10 / 1.8.9 / 1.9.4 / 1.10 / 1.11 / 1.12)
IndustrialCraft² recent version: v1.117!

Recipes

  • EatYourCookie
  • Oct 10th 2015
1st Official Post
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 10th 2015
    • #1

    Hello,


    I'm maing a mod that add some more stuf to IC2 but I can't find how to add a recipe of a Macerator, Extractor, OreWasher, etc.
    so my question is how to add those recipes


    tnx for Helping Eat.

    • Quote
  • xbony2
    Official FTB Wiki editor
    Reactions Received
    9
    Posts
    908
    Location
    United States of America
    • Oct 10th 2015
    • #2

    Checkout this for examples. I think they all should still work, although I haven't updated that mod in a long time.

    Help the Official FTB Wiki reach a billion pages! [I had to keep changing it so there ^^]

    Someone should fix the gravel texture in the background. It's been years now, come on people.

    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 10th 2015
    • #3

    K I found it ty

    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 10th 2015
    • #4

    nvm

    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 11th 2015
    • #5
    Quote from xbony2

    Checkout this for examples. I think they all should still work, although I haven't updated that mod in a long time.

    Yes it's outdated, you use "IC2RecipeInput" but it isn't used any more do know something that can replace it?

    • Quote
  • xbony2
    Official FTB Wiki editor
    Reactions Received
    9
    Posts
    908
    Location
    United States of America
    • Oct 11th 2015
    • #6

    IC2RecipeInput is a class made by me actually, here .

    Help the Official FTB Wiki reach a billion pages! [I had to keep changing it so there ^^]

    Someone should fix the gravel texture in the background. It's been years now, come on people.

    • Quote
  • Player
    IC² Coder
    Reactions Received
    24
    Posts
    1,042
    • Oct 12th 2015
    • Official Post
    • #7

    IC2 already provides RecipeInputItemStack in the API, which is faster due to internal caching. The only difference seems to be that IC2's supports the wildcard metadata value.

    • Next Official Post
    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 17th 2015
    • #8

    It's working thnx. but I have one more problem with building the mod to a jar file. apparently when I try "gradlew build" it can't find the Api do you know how to fix that?

    Edited once, last by EatYourCookie (Oct 17th 2015).

    • Quote
  • Aroma1997
    IC² Developer
    Reactions Received
    55
    Posts
    999
    • Oct 17th 2015
    • Official Post
    • #9

    put the IC2API into ./src/api/java

    Check out my mods here.

    • Previous Official Post
    • Next Official Post
    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 17th 2015
    • #10

    K Tnx it's all working now

    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 18th 2015
    • #11

    actually there is one things I have trouble with.
    in the Ic2Items class of the api I can get items but the problem is it's an item stack.
    so if I want to use by example an copper ingot to create a copper pickaxe, I can't it returns an error when you try to run your mod
    becouse it's an itemstack.
    how can you just get it as an Item

    • Quote
  • Player
    IC² Coder
    Reactions Received
    24
    Posts
    1,042
    • Oct 18th 2015
    • Official Post
    • #12

    Recipes use item stacks directly, there's no need to convert to items first. The conversion loses information about the metadata, if you really need it you can call ItemStack.getItem().


    Don't forget to check anything retrieves from Ic2Items if it's null.

    • Previous Official Post
    • Next Official Post
    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 18th 2015
    • #13

    But I wan't to know how to use the ic2 items in your crafting recipe so normaly you do by example

    Code
    GameRegistry.addRecipe(new ItemStack(UUtools.copper_pickaxe), new Object[]{"CCC", " S ", " S ", 'C', <<Copper>>, 'S', Items.stick});


    so I thought I could use

    Code
    GameRegistry.addRecipe(new ItemStack(UUtools.copper_pickaxe), new Object[]{"CCC", " S ", " S ", 'C', IC2Items.getItem("copperIngot"), 'S', Items.stick});

    Edited once, last by EatYourCookie (Oct 18th 2015).

    • Quote
  • Player
    IC² Coder
    Reactions Received
    24
    Posts
    1,042
    • Oct 19th 2015
    • Official Post
    • #14

    This should be fine, except for the null checks. The recipe implementation behind GameRegistry.addRecipe takes Block, Item or ItemStack instances.


    A potential issues why this may not work is if you do this from the PreInitialization event, which is too early to assume IC2 to have its stuff loaded. Use the Initialization event instead.

    • Previous Official Post
    • Next Official Post
    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 20th 2015
    • #15

    Yes but I have some trouble witn that also with the IC2 Recipes By Example

    Code
    RecipeInputItemStack input1 = new RecipeInputItemStack(new ItemStack(TMblocks.silver_ore));		Recipes.macerator.addRecipe(input1, null, IC2Items.getItem("crushedSilverOre"));


    so this a macerator recipe but I want to return 2 crushedSilverOres and normaly I should do if it was an item by example

    Code
    RecipeInputItemStack input1 = new RecipeInputItemStack(new ItemStack(TMblocks.silver_ore));		Recipes.macerator.addRecipe(input1, null, new ItemStack(IC2Items.crushedSilverOre, 2);


    and I can't becouse the IC2Items.getItem is already an ItemStack.

    • Quote
  • Aroma1997
    IC² Developer
    Reactions Received
    55
    Posts
    999
    • Oct 20th 2015
    • Official Post
    • #16

    You can.
    The ItemStack you get from the IC2API is now called ItemStackA

    Just create a new ItemStack using the Item of ItemStackA, the Metadata of ItemStackA and the amount you want.

    Check out my mods here.

    • Previous Official Post
    • Next Official Post
    • Quote
  • EatYourCookie
    Tree Cutter
    Posts
    12
    • Oct 21st 2015
    • #17

    K

    • Quote
  • Player
    IC² Coder
    Reactions Received
    24
    Posts
    1,042
    • Oct 22nd 2015
    • Official Post
    • #18

    or even better, ItemStack newStack = oldStack.copy(); newStack.stackSize = 2; -> use newStack in the recipe

    • Previous Official Post
    • Quote

Share

  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Pinterest
  1. Privacy Policy
Powered by WoltLab Suite™