Jump to content

Help with separate Creative Tabs and Recipes files?


Shadzari

Recommended Posts

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!

Link to comment
Share on other sites

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();)

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Yeah, I'll start with the ones I added last night.  Wasn't crashing until today and wasn't crashing at all yesterday (+past few days since removing Cupboard), so deductive reasoning says it's likeliest to be one of the new ones.  A few horse armor mods and a corn-based add-on to Farmer's Delight, the latter which I hope to keep - I could do without the horse armor mods if necessary.  Let me try a few things and we'll see. 
    • Add crash-reports with sites like https://mclo.gs/ Add this mod: https://www.curseforge.com/minecraft/mc-mods/packet-fixer/files/5416165
    • Maybe - remove recently added mods one by one
    • Temu, a popular online shopping platform, is currently offering an exclusive coupon code for Australian customers that can unlock significant savings. If you want to save money on your next purchase, the coupon code {act892435} is your key to unlocking AU$100 off your order, along with additional discounts on select items. How to Use the Coupon Code {act892435} Using the coupon code is straightforward. Follow these simple steps to maximize your savings: Download or Open the Temu App: If you haven't already, download the Temu app from your app store or visit the Temu website. Add Items to Your Cart: Browse through Temu’s vast selection of products and add your desired items to your shopping cart. Proceed to Checkout: Once you have finished shopping, go to your cart and click on the checkout button. Enter the Coupon Code: Look for the "Promo Code" or "Coupon Code" field on the checkout page. Enter {act892435} into this field and click “apply.” Enjoy Your Savings: After applying the code, you will see a deduction of AU$100 from your total order amount, plus you may receive an additional discount of 30% to 70% off on select items. Benefits of Using {act892435} The coupon code {act892435} is particularly beneficial for several reasons: Significant Savings: The AU$100 discount applies to your entire order, making it a great opportunity for larger purchases. Additional Discounts: In addition to the AU$100 off, you can stack this coupon with other promotions that offer up to 70% off select items, maximizing your savings potential. No Minimum Purchase Requirement: There’s no minimum spend required to use this coupon, allowing you to use it on any size order. Tips for Maximizing Your Savings To get the most out of the {act892435} coupon code, consider these tips: Shop Strategically: Since the AU$100 discount applies to your total order, consider purchasing multiple items or higher-priced products to maximize your savings. Check Eligible Items: Make sure to add items that qualify for additional discounts (30% to 70% off) to benefit from both offers. Stay Updated on Promotions: Keep an eye on Temu’s app and website for flash sales and limited-time offers that can further enhance your savings. Additional Ways to Save on Temu While using the coupon code {act892435} is one of the best ways to save right now, there are other strategies you can employ: Explore the Deals Section: Regularly check Temu's "Deals" section in the app for time-sensitive offers and sales. Follow Social Media Accounts: By following Temu’s Australian social media pages, you may gain access to exclusive promo codes not available elsewhere. Sign Up for Newsletters: Subscribe to Temu’s email newsletter for updates on new deals and additional discount codes delivered directly to your inbox. Conclusion The exclusive coupon code {act892435} offers Australian shoppers a fantastic opportunity to save AU$100 on their next Temu purchase while also enjoying extra discounts on select items. By following simple steps during checkout and employing strategic shopping techniques, you can maximize your savings significantly. Don’t miss out on this limited-time offer—head over to Temu today and start shopping! Share
    • No, I have both of those on.  Are they triggering as potential crash errors, even though suspected mods are "none"?  Apologies, I'm relatively new at modding Minecraft.   Edit: What's odd to me is that I've had both of those on literally from world inception (over three weeks real-world time, I think?) and never had issue with either.  I wonder if something added afterwards is causing incompatibilities.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.