Hello! Another newbie trying to use MC modding to help learn java. I'm a few days in and I have blocks, items, armor (with effects!), textures, custom mob drops, ETC. I was working on recipes today and ran into a snag. For the sake of example, let's say a mod adds 9 different flowers, and they can be crafted into a block using a shapeless recipe. I got this to work using one of each item on the crafting grid, but what if I want the actual recipe to be any combination of the 9 flowers? Is there a way (without making endless shapeless recipe lines) to allow the player to craft this block with 9 of one type of flower, or 3 of 3 types, or just allow any combination? Sorry if I'm not being clear enough... just as long as the player has any 9 flowers to put anywhere in the grid, they can craft the block.
Also sorry if this is in the wrong place. Still getting my feet wet. Thanks in advance for any info!
The advice below assumes you're using Forge. I think the first paragraph below will work without it (assuming you use CraftingManager instead of GameRegistry), but the second depends on Forge.
If your flowers are all metadata values of one block, simply passing the Block object as input to GameRegistry.addShapedRecipe or GameRegistry.addRecipe(ItemStack, Object...) will allow you to use any metadata value of that block as input.
If your flowers are items or separate blocks, you'll need to add them to the ore dictionary (using OreDictionary.registerOre) and use GameRegistry.addRecipe(new ShapedOreRecipe(...)) or GameRegistry.addRecipe(new ShapelessOreRecipe(...)) to add the recipe. Ore recipes use ore dictionary names instead of Blocks/Items/ItemStacks for inputs when you want to use anything registered for that name.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thanks! I was wondering if meta was the way to go. Gonna give it a whirl!
I tried changing all of my separate items into a metaitem and started getting errors I couldn't figure out, so decided to try the ore dictionary instead. That was easier than I thought! Thanks again!!!
Also sorry if this is in the wrong place. Still getting my feet wet. Thanks in advance for any info!
If your flowers are all metadata values of one block, simply passing the Block object as input to GameRegistry.addShapedRecipe or GameRegistry.addRecipe(ItemStack, Object...) will allow you to use any metadata value of that block as input.
If your flowers are items or separate blocks, you'll need to add them to the ore dictionary (using OreDictionary.registerOre) and use GameRegistry.addRecipe(new ShapedOreRecipe(...)) or GameRegistry.addRecipe(new ShapelessOreRecipe(...)) to add the recipe. Ore recipes use ore dictionary names instead of Blocks/Items/ItemStacks for inputs when you want to use anything registered for that name.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I tried changing all of my separate items into a metaitem and started getting errors I couldn't figure out, so decided to try the ore dictionary instead. That was easier than I thought! Thanks again!!!
Now on to the next issue...