Jump to content

[1.7.10][SOLVED] Load Order question


TheTrueForce

Recommended Posts

I'm trying to move most of my MineTweaker scripts into a mod(mostly for the exercise), and that involves removing a number of recipes.

I've only tried to move one crafting recipe in so far, and the adding worked. I tried to remove the recipe that it's supposed to be replacing(the Thermal Foundation Silver Gear), but that didn't work.

I've tracked the problem down to load order: TF is loading after my mod.

My mod is set to load after TF in its @Mod annotation and to require TF in the mcmod.info file, yet it still does postInit after TF. Because TF adds its recipes during its postInit, mine needs to happen after TFs. How can I make this happen?

My entire source code can be found here: https://github.com/TheTrueForce/MCLTweaks

The problem code is here: https://github.com/TheTrueForce/MCLTweaks/blob/master/src/java/com/trueForce/mclTweaks/Crafting.java#L28

Also, the code I'm using to remove the recipe(the removeMCrecipe() method) was designed for MC 1.3.2. Is it still valid?

EDIT: I'm stumped on how to remove/replace a Mekanism Shaped crafting recipe. Does anyone know how to do this?

 

Link to comment
Share on other sites

In other words, have you tried adding your recipes during init and removing others during post-init?

 

Also, there are more, lesser-known, FML stages even after post-init. Just in case some mod injected its recipes during post-init, you could still trump them.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

Also, the code I'm using to remove the recipe(the removeMCrecipe() method) was designed for MC 1.3.2. Is it still valid?

 

EDIT: I'm stumped on how to remove/replace a Mekanism Shaped crafting recipe. Does anyone know how to do this?

 

IRecipe

provides the

getRecipeOutput

method, there's no need to check for specific implementations of it like you are now. This will allow any recipe type to be removed.

 

You can add a

ShapedRecipe

/

ShapedOreRecipe

as a replacement for a

MekanismRecipe

; but it won't have the ability to check for specific gas/energy values, item tiers or factory types and it won't transfer energy/gas from the input items to the output item. If you want this functionality, add Mekanism as a dependency and add a

MekanismRecipe

instead of a standard shaped recipe.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Jabelar:

I am calling my recipe delete code in postInit already, and I've used @Mod to specify that I want my mod to load after TF and CoFH Core. I also have an mcmod.info file, which I suspect may be overriding my @Mod annotation as regards load order.

I am adding my own recipes during Init and removing/replacing recipes during postInit. I've followed BedrockMiner's tutorials and sent that to my CommonProxy.

JeffryFisher:

I have added my own recipes in Init, and tried to remove and replace recipes during postInit.

Your comment about further stages is interesting. What are they, and how can I use them? Same way as with the usual three?

Choonster:

Thanks for that info on IRecipe. I obtained that code from an old thread on this site, so I've reworked that method to incorporate that.

As for the MekanismRecipe thing, I'm trying to disable some of those recipes in order to replace them, because I couldn't do that with MineTweaker. Thinking of MekanismRecipes, the altered remover can remove them. It does help that Mekanism adds its recipes during init.

Also, I was reading a thread about recipe removal on MC 1.8, and they recommended using an Iterator instead of an index in a for loop. Should I try switching over? I've never used an Iterator before, but I'm willing to have a go.

 

Link to comment
Share on other sites

Also, I was reading a thread about recipe removal on MC 1.8, and they recommended using an Iterator instead of an index in a for loop. Should I try switching over? I've never used an Iterator before, but I'm willing to have a go.

 

Yes, I'd recommend using a for-each loop when just iterating (which uses the

Iterator

under the hood) or explicitly using the

Iterator

when you need to remove elements while iterating.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

To see the other FML events you might handle, just jump to the definition of preInit, init and/or postInit event type that you're already using as the input parameter to each main handler (in Eclipse that's easy). You should find yourself in a place that defines those three and some others.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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

    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • Add the ful lcrash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here
    • I cant craft any of the epic fight mod weapons. I try using the recipes in the crafting table but nothing is working. and when i click on the epic fight weapon in jei there is no recipe at all.
    • Hello All! Started a MC Eternal 1.6.2.2 server on Shockbyte hosting. The only other mod I added was betterfarmland v0.0.8BETA. Server is 16GB and Shockbyte wont tell me how many CPU cores i have.  We are having problems now when players log in it seems to crash the server. At other times it seems fine and we can have 3 people playing for hours at a time. Usually always when it does crash it is when someone logs in. Crash Reports Below. To the person who can post the fix I will reward $100 via Paypal.   ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 2024-09-19 21:04:58 UTC Description: Exception in server tick loop java.lang.StackOverflowError     at net.minecraft.advancements.PlayerAdvancements.hasCompletedChildrenOrSelf(PlayerAdvancements.java:451)     at net.minecraft.advancements.PlayerAdvancements.shouldBeVisible(PlayerAdvancements.java:419)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:385)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.P  
  • Topics

×
×
  • Create New...

Important Information

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