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.
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.
K I found it ty
nvm
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?
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.
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?
put the IC2API into ./src/api/java
K Tnx it's all working now
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
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.
But I wan't to know how to use the ic2 items in your crafting recipe so normaly you do by example
GameRegistry.addRecipe(new ItemStack(UUtools.copper_pickaxe), new Object[]{"CCC", " S ", " S ", 'C', <<Copper>>, 'S', Items.stick});
so I thought I could use
GameRegistry.addRecipe(new ItemStack(UUtools.copper_pickaxe), new Object[]{"CCC", " S ", " S ", 'C', IC2Items.getItem("copperIngot"), 'S', Items.stick});
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.
Yes but I have some trouble witn that also with the IC2 Recipes By Example
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
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.
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.
K
or even better, ItemStack newStack = oldStack.copy(); newStack.stackSize = 2; -> use newStack in the recipe