Posted May 30, 201411 yr Hey, does someone know how i can add Recipes to this gui? https://lh6.googleusercontent.com/-ArTaN4mTbTI/U4ibdv02K4I/AAAAAAAAAKE/gdIqT0WI_9E/s256-no/blockmixergui.png[/img] I made this gui by my own and everything is working fine. I can put items into the slot and all these things a gui has to do. But i dont know how to add recipes. If you know any tutorial for this or you know it, please send it to me. Thanks Creator of Extra Shoes Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then
May 30, 201411 yr Author Please help me Creator of Extra Shoes Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then
May 30, 201411 yr Okay, this may or may not be a long post This took me hours of figuring out, so I hope this helps Now, in your TileEntity class(I hope you have one ) you should have a line something like this(if you don't make one, say if you want the full method code : ItemStack itemstack = BlenderRecipies.getSmeltingResult(ITEMSTACKNAME[0].getItem().itemID, ITEMSTACKNAME[1].getItem().itemID); Now, change the varibles to your coresponding varibles. Now, you have to fiddle around with that line of code. Pretty self-explanatory, but add ITEMSTACKNAME[0].getItem().itemID as many times as slots you have in your gui(input), but change the array. For instance, your third one would be ITEMSTACKNAME[2].getItem().itemID , and so on. Bear in mind the code I pasted is for a two slot input. You don't want the BlenderRecipies part, so make your own class called whatever you like(I'd recommend something like BLOCKNAMERecipies) And paste this code inside the class: public CLASSNAME() { } public static ItemStack getSmeltingResult(int i, int j, int k, int l, int m) { return getOutput(i, j, k, l, m); } private static ItemStack getOutput(int i, int j, int k, int l, int m) { } Now inside getOutput, you'll want a bunch of if statments(I guess you could do a for loop, but if statments are a lot easier) for your Recipies. I'm not going to explain how it works, it's extremely easy to see what it does just by looking at it. Here is an example: if(i == MainModdingFile.ITEMNAME.itemID && j == MainModdingFile.ITEMNAME.itemID && k == MainModdingFile.ITEMNAME.itemID && l == MainModdingFile.ITEMNAME.itemID && m == MainModdingFile.ITEMNAME.itemID{ return new ItemStack(MainModdingFile.ITEMNAME); } Bear in mind, that this only works if the items are in a particular order, if you want a "shapeless recipie" as it could be called, you can use || (OR in boolean) to do that. Here are two examples, one of a basic recipe, and one for a shapeless recipe. BASIC: if(i == morefoodmod.ItemBanana.itemID && j == morefoodmod.ItemStrawberry.itemID){ return new ItemStack(morefoodmod.ItemStrawberryBananaSmoothie); } SHAPELESS: if(i == morefoodmod.ItemBanana.itemID && j == morefoodmod.ItemStrawberry.itemID || i == morefoodmod.ItemStrawberry.itemID && j == morefoodmod.ItemBanana.itemID){ return new ItemStack(morefoodmod.ItemStrawberryBananaSmoothie); } I hope this helps a bit
May 30, 201411 yr Also, that code is made for 1.6.4 - so there is gonna be some errors most likely. Can you just google em, don't know any 1.7 fixes
May 30, 201411 yr @Xcox123, That code is completely worthless code for a cut&paster working on a 1.7.2 mod. Please, try not to confuse people with worthless or incorrect gratutitous code. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
May 30, 201411 yr @sequituri, In what way is it worthless? He asked for a tutorial. Admitidly, I didn't explain everything, but it's not too hard to figure out. I did specificly say that the code was 1.6.4, and that there was going to be errors. But I'm the only person here who bothered to help. However, with a bit of modifying on their side, it can work. So, my post was in no way "worthless and incorrect", it showed him/her the basic way to add a recipie for a special GUI, and thats what I did. He/her didn't ask for any big explanations on anything.
May 30, 201411 yr You might as well tell him to look at minecraft crafting recipe manager. That is the type of code one could use. sequituri was probably talking about your CLASSNAME "example". It doesn't contain any valuable code nor information. That kind of stuff : public class TheUltimateAnswer{ public static Object getSolution(Object allHumankindProblems){ //TODO: Think of something return 42; } }
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.