Jump to content

Recommended Posts

Posted

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?

 

Posted

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.

Posted
  On 1/7/2016 at 11:02 PM, TheTrueForce said:

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.

Posted

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.

 

Posted
  On 1/11/2016 at 7:04 AM, TheTrueForce said:

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.

Posted

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.

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

    • Start by following the docs to get a workspace setup: https://docs.minecraftforge.net/en/latest/gettingstarted/ Then poke around some of the tutorials, https://www.mcjty.eu/docs/1.20/ used to be the goto, but not sure if there are any updates for regular forge or not, but if you've brushed up on Java, it will be enough to get you started. Poke around the Minecraft and Forge sources to see how things are done. Read the FAQ for information on how to post code/logs when you run into issues. Share as much info on issues you have as possible. Use github to host projects, chances of someone helping are higher when they can actually see all your code and/or build it themselves. And finally, keep it on the forums, don't direct message people with questions, most people do not provide personal support like that. Also keep in mind forums posts are not always immediately answered, if you're looking for a quicker response, you can always try the Minecraft Forge discord server.
    • Hello, I have a Forge Minecraft sever (I host it at g-portal.com) which has always worked fine and I had no problems, but today it doesn't wanna work anymore. Today I started the server and the status said online, but after a few seconds it said this: "Start failed". And then out of nowhere it restarted itself and the same thing happened again and again and now it's in an infinite loop where it just keeps failing and then restarts. Here's the download link for the server logs: https://www.mediafire.com/file/sq30dgoonjevib1/2025-07-06-1.log/file Does anyone know how to fix this? If yes I would really appreciate help. Best wishes, Gabs1107
    • I'm experiencing a critical issue on a dedicated Arch Linux server running the latest Forge for Minecraft 1.20.1. When a player exits a Nether portal (not enters, and not via /tp) or teleports into the End via portal, the server completely freezes for 1–10 minutes. During this time, all commands are unresponsive, and the game world essentially locks up. This is with watchdog disabled. Environment: OS: Arch Linux (latest packages) Java: OpenJDK 17 (up to date) Forge Version: Latest 1.20.1 (tested multiple versions from the past ~3 months) Mods: None (issue occurs on a clean install) Server Type: Proxmox VM with: 4 virtual cores 64 GB RAM (63 GB allocated via -Xmx and -Xms flags) Observed Behavior: Observed Behavior: The server freezes for 1–10 minutes when: Exiting a Nether portal (entering does not trigger the issue) Entering or exiting the End using a portal Teleporting using commands (e.g., /tp) works only for the Nether; teleporting to the End via command also causes a freeze The issue occurs anywhere in the world, not tied to specific coordinates or builds During the freeze: The server becomes completely unresponsive to all commands and player actions No crash reports, no errors, and no warnings are logged CPU usage remains under 50%, and RAM usage stays around 6–14 GB After 1–10 minutes, the server recovers automatically and resumes normal operation
  • Topics

×
×
  • Create New...

Important Information

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