Posted July 30, 201312 yr Hi. In my mod i have a recipe for a basic rod and a lapis lazuli ingot: GameRegistry.addSmelting(Item.dyePowder.itemID, new ItemStack(LapisIngot), 1.0F); GameRegistry.addShapelessRecipe(new ItemStack(BasicRod, 4), new ItemStack(Block.wood), new ItemStack(Block.wood)); But in game you can only craft a basic rod with oak wood and you can craft a lapis lazuli ingot with any dye. How can i fix this?
July 30, 201312 yr add recipe for any/every type of wood you want aka new ItemStack(wood.blockID) and new ItemStack(wood.blockID, 0) new ItemStack(wood.blockID, 1) new ItemStack(wood.blockID, 2) new ItemStack(wood.blockID, 3) are tottally different, one of those reference specificly jungle wood, another might refer birch wood etc note this is not actually what you want to write because i dont know exactly what the constructors of ItemStack look like but i think its new ItemStack(int id) new ItemStack(int id, int quantity) new ItemStack(int id, int quantity, int meta) and not necesserelly in that order look at net.minecraft.item.ItemStack for more info how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 30, 201312 yr FurnaceRecipes.smelting().addSmelting(Item.dyePowder.itemID, 4, new ItemStack(LapisIngot), 100.0F); CraftingManager.getInstance().addShapelessRecipe(new ItemStack(Item.blazeRod), new ItemStack(Block.wood, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Block.wood, 1, OreDictionary.WILDCARD_VALUE));
July 30, 201312 yr CraftingManager.getInstance().addShapelessRecipe(new ItemStack(Item.blazeRod), new ItemStack(Block.wood, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Block.wood, 1,OreDictionary.WILDCARD_VALUE)); we have wildcards ?!?!?!? that is sweet!!! how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 30, 201312 yr Author add recipe for any/every type of wood you want aka new ItemStack(wood.blockID) and new ItemStack(wood.blockID, 0) new ItemStack(wood.blockID, 1) new ItemStack(wood.blockID, 2) new ItemStack(wood.blockID, 3) are tottally different, one of those reference specificly jungle wood, another might refer birch wood etc note this is not actually what you want to write because i dont know exactly what the constructors of ItemStack look like but i think its new ItemStack(int id) new ItemStack(int id, int quantity) new ItemStack(int id, int quantity, int meta) and not necesserelly in that order look at net.minecraft.item.ItemStack for more info Ok how do I add a different wood though that doesnt make much sense because I can't specify in ItemStack
July 30, 201312 yr well you might want to try Guff code first. i dont actually have any item in my mod so i dont know for sure but ItemStack(Item.itemID) woudl call: [code]public ItemStack(Item par1Item) { this(par1Item.itemID, 1, 0); } which would in his turn call: public ItemStack(int par1, int par2, int par3) { this.itemID = par1; this.stackSize = par2; this.itemDamage = par3; if (this.itemDamage < 0) { this.itemDamage = 0; } }[/code] meaning second int is the quantity, third is the meta so to get and considering this: //in class BlockWood public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); par3List.add(new ItemStack(par1, 1, 1)); par3List.add(new ItemStack(par1, 1, 2)); par3List.add(new ItemStack(par1, 1, 3)); } my bet is meta 0 = oak, 1 = spruce, birch = 2, jungle = 3; but try guff first cuz thatll make less code and cleaner code how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 30, 201312 yr Author well you might want to try Guff code first. i dont actually have any item in my mod so i dont know for sure but ItemStack(Item.itemID) woudl call: [code]public ItemStack(Item par1Item) { this(par1Item.itemID, 1, 0); } which would in his turn call: public ItemStack(int par1, int par2, int par3) { this.itemID = par1; this.stackSize = par2; this.itemDamage = par3; if (this.itemDamage < 0) { this.itemDamage = 0; } }[/code] meaning second int is the quantity, third is the meta so to get and considering this: //in class BlockWood public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); par3List.add(new ItemStack(par1, 1, 1)); par3List.add(new ItemStack(par1, 1, 2)); par3List.add(new ItemStack(par1, 1, 3)); } my bet is meta 0 = oak, 1 = spruce, birch = 2, jungle = 3; but try guff first cuz thatll make less code and cleaner code Ok thanks
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.