Posted January 20, 201312 yr I have been wondering how can I make it so in a recipe you need a certain amount of something? (for example 64 Stone, 38 Wood etc.)
January 20, 201312 yr You will need a custom crafting handler like in redpower its alloy furnace ~I was here~
January 20, 201312 yr Author You will need a custom crafting handler like in redpower its alloy furnace That is not right at all. You need to make a custom recipe (instance of IRecipe) and use that. Thank you for replying, also I am clueless as to how I can do that, do you mind helping a little?
January 20, 201312 yr Just copy the IRecipe into a new class file, make a new addRecipe, and add a small if statement into your IRecipe to check if the slot stacksize and item stacksize are the same... It will force having the correct stackSizes but oncrafted it only removed 1 :\ I do not know how to fix this, just mess with it. Maybe make a craftingHandler, and set the oncrafted to check if it was your recipe? i dont know...
January 20, 201312 yr Author Just copy the IRecipe into a new class file, make a new addRecipe, and add a small if statement into your IRecipe to check if the slot stacksize and item stacksize are the same... It will force having the correct stackSizes but oncrafted it only removed 1 :\ I do not know how to fix this, just mess with it. Maybe make a craftingHandler, and set the oncrafted to check if it was your recipe? i dont know... I'm one of those people who learn better from actually looking at code, I tried to do what you said but when it came to adding a new addRecipe eclipse was giving me errors saying 'Syntax Error at Token . / )' package sealab.stackpack; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public interface StackRecipe { /** * Used to check if a recipe matches current crafting inventory */ boolean matches(InventoryCrafting var1, World var2); /** * Returns an Item that is the result of this recipe */ ItemStack getCraftingResult(InventoryCrafting var1); /** * Returns the size of the recipe area */ int getRecipeSize(); ItemStack getRecipeOutput(); GameRegistry.addShapelessRecipe(new ItemStack(Base.stoneStack), new Object[] { new ItemStack(Base.Stack), new ItemStack(Block.stone) }); } It's probably something obvious that I just looked past.
January 20, 201312 yr First of all, your Recipe class should implement IRecipe, then copy the addRecipe code from the CraftingManager and change the file declarations to your new class that extends IRecipe...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.