lionel5116 Posted February 29, 2016 Share Posted February 29, 2016 I have an issue concerning a recipe that I created for rendering an item that I created based on the itemPickAxe class. I don't think it has to do with the class that it extends itself, but with the way the recipe is working. I have attached the code on GitHub (like you suggested) at: https://gist.github.com/lionel5116/ If you look at the file "ModRecipes.java", you notice a block of code: For some reason, If I use a pattern: GameRegistry.addRecipe(new ItemStack(ModItems.ljonesbadasspickaxe), new Object[]{ "R", "RR", 'R', Blocks.cobblestone[/b] }); It will not create the item using the pattern shown, but the weird thing is, it will create the pickaxe if I remove the segment on the second row of the pattern, like the pattern shown below: GameRegistry.addRecipe(new ItemStack(ModItems.ljonesbadasspickaxe), new Object[]{ "R", "R", 'R', Blocks.cobblestone }); If look at the code for sword here: //let's make a recipe for my bad ass sword GameRegistry.addRecipe(new ItemStack(ModItems.ljonesmastersword), new Object[]{ "SS", "SS", "SS", 'S', Blocks.cobblestone }); This pattern works as it should using the pattern outlined. I have attached all of my main files on Git as mentioned: https://gist.github.com/lionel5116/ Quote Link to comment Share on other sites More sharing options...
Palinator2 Posted February 29, 2016 Share Posted February 29, 2016 "R", "RR", 'R', means: R . R R and . R R R will work ("." = empty), can you confirm? PS: also works: GameRegistry.addRecipe(new ItemStack(ModItems.ljonesbadasspickaxe), "R", "RR", 'R', Blocks.cobblestone); Quote Link to comment Share on other sites More sharing options...
lionel5116 Posted March 2, 2016 Author Share Posted March 2, 2016 Thanks for the response, based on your observation and "me" looking at the code closer (a second pair of eyes), there were "2" mistakes I was making, first "all" of the strings for each row in the grid "MUST" be of the same size (or you will get an indexOutRangeException), then the last row item for the common character must be in ' ' (single quotes), I don't know how I missed that.. (looking at to hard I guess), now "all of my patterns work"... so even if I use: GameRegistry.addRecipe(new ItemStack(ModItems.ljonesbadasspickaxe), "R", "RR", 'R', Blocks.cobblestone); - that crashed..., but once I modified the code to: GameRegistry.addRecipe(new ItemStack(ModItems.ljonesbadasspickaxe), "R ", "RR", 'R', Blocks.cobblestone); - that worked !! Thanks guys.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.