Posted May 24, 201411 yr I'm having a really odd issue with adding a new recipe. When I try and add a shapeless recipe using my blocks, it won't work. When I try and do it using my items, it works fine. Here are my shapeless recipe adds. The one with asterisks doesn't work. Anyone know why? //Recipe Stuff ItemStack bowl = new ItemStack(Item.getItemById(281)); //bowl ItemStack redMush = new ItemStack(Block.getBlockById(40)); //red ItemStack brownMush = new ItemStack(Block.getBlockById(39)); //brown ItemStack yellowMush = new ItemStack(lemoncup); ItemStack orangeMush = new ItemStack(orangecap); ItemStack mushroomStew = new ItemStack(Item.getItemById(282)); //mushroomstew GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, orangeMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, redMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, brownMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, redMush, orangeMush}); GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, brownMush, orangeMush}); **GameRegistry.addShapelessRecipe(new ItemStack(this.lemoncupPlanks), new ItemStack(this.lemoncupTrunk));** GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Blocks.acacia_stairs)); EDIT: Solved it! Finally. Like was said below, you have to use the accessor classes Blocks and Items to call vanilla items and blocks to ItemStacks going forward. For some reason, I had to set up my own accessor class to get my blocks to work in ItemStacks as well. I can reference item instances just fine, but I have to reference blocks through my own personal Blocks class (I called it ModBlocks) which included nothing but a bunch of variables for each block (public static block Name = (Block)BlockRegistry.Name;). It somehow changes the accessibility of the block. Don't know why.
May 24, 201411 yr You are modding for Minecraft 1.7.2, no? Item ids (and block ids) are a no-no. Don't use them for that. Items.itemName and Blocks.blockName are the proper methods to refer to vanilla blocks and items. Also, your recipes are not coded sensibly. You do not need array notation to call a var-args method. GameRegistry.addShapelessRecipe(mushroomStew, new Object[]{bowl, yellowMush, orangeMush}); should be GameRegistry.addShapelessRecipe(mushroomStew, bowl, yellowMush, orangeMush); -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
May 24, 201411 yr Author Ah cool. Thanks for that. I've been trying to update from 1.5 and I keep missing things.
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.