Posted June 19, 201312 yr I apologize if this has been asked and solved before, but I did search and couldn't find anything useful. I've got the basics of Java, but it's deep code that I'm not familiar with yet and I would like to ask for some help. What I would like to do is be able to take my code for creating new creative tabs and for registering new recipes out of my central mod file and place them in their own separate files. Will a simple 'Blah extends BlahBlah' in the separate files suffice, or will I need to put some code inside the central mod file to make load references to those separate files? (Maybe import the separate files in the central mod file?) Additionally, I do have a concern about the functionality of doing this with the creative tabs. Will my items and blocks be allocated to their correct tabs if all the code is in a separate file? Thanks for the help and the patience!
June 19, 201312 yr You will need some reference to the files (and no, a simple import will not do it.) As long as the blocks are allocating themselves to your tab, though, it will work. BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 19, 201312 yr i do it also like that as recipes class you must have as example : package invizzble.mods.nc.recipes; import net.minecraft.item.ItemStack; import invizzble.mods.nc.items.ModItems; import invizzble.mods.nc.items.ModTools; import cpw.mods.fml.common.registry.GameRegistry; public class ShapedRecipes { public static void init(){ GameRegistry.addRecipe(new ItemStack(ModItems.NightmareFuel), "xxx", "xyx", "xxx", Character.valueOf('x'), ModItems.NightMareDust, Character.valueOf('y'), ModItems.CreepyCoal); GameRegistry.addRecipe(new ItemStack(ModTools.NightmarePick), "xyx"," z " ," z ", Character.valueOf('x'), ModItems.DarkenedIngot, Character.valueOf('y'), ModItems.DarkOrb, Character.valueOf('z'), ModItems.DarkStick); GameRegistry.addRecipe(new ItemStack(ModItems.DarkOrb), "xxx", "xyx", "xxx", Character.valueOf('x'), ModItems.NightmareDiamond, Character.valueOf('y'), ModItems.NightMareDust); } } and then you just need to add in you init method -your classname-.-name you called your method- (in this example was it : ShapedRecipes.init() http://i.imgur.com/sKDS7bj.png[/img] http://www.minecraftforum.net/topic/1877292-15x-forge-smp-nightmarecraft-alpha-10-it-started-with-a-dream-new/
June 22, 201312 yr Author Thank you for the help! Just for clarification: I should have a separate file for both shaped and shapeless recipes? Your code looks like you've got a package for recipes, but a single file for each type. So, if that's the case, I should have two files in my Recipes package and in the @init in my coremod file I should have: ShapedRecipes.init(); ShapelessRecipes.init(); +karma for you, too
June 22, 201312 yr You can have both in the same class. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
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.