More Avaritia

More Avaritia

1M Downloads

[Suggestion] Register recipes in the recipe register event

CritFlaw opened this issue · 14 comments

commented

Hi, I would love to use your mod but change some things around with Craft Tweaker. Would you be willing to change the mod so the recipes register in the recipe register event? That way CrT can run later and make changes.

commented
commented

It's a very useful mod pack-dev side that can add, remove, modify recipes among many other advanced functions like events and functions. It's the successor to mine tweaker. This would be how you add the creative powercell with CrT (with a couple of items changed) https://hastebin.com/tekimuyobe.xml

The issue is that your mod seems to register things later in initialization than Craft Tweaker. One of the devs said you should be registering recipes in the recipe register event instead of where you're doing it now.

commented

I found the event you are talking about, I'm about to upload another file, and you can tell me if it works how you want it to.
Also, keep in mind I have config options to disable literally every recipe, so that is always an option, just disable it in my config and make a new one with CrT.

commented

Yeah, Github seems bad about updating, I got emails with your replies thht don't appear here.

Yes, you can disable recipes but that's more of a black & white approach, I was looking to replace specific materials like the singularities which aren't used in my pack. Something that's possible with zenscript using recipes.replaceAllOccurences(avaritia:singularity:3, economy:item_packetfivehundreed);
Which replaces any time the redstone singularity is used in a crafting recipe, with a packet of five hundred dollar bills from the economy mod.

Appreciate the update, will let you know if it works shortly.

commented

Alright cool, and the reason you got an email for a message that doesn't appear here is cause I made a message then deleted it when I saw you had already added more info, but Git didn't refresh till I hit comment!

commented

It doesn't seem to work.

commented

Not sure what else I would need to do to make it work, I did the recipe event here

commented

Ah this won't work because that method only works for normal crafting recipes, not avaritia ones...

commented

Like I said, not sure what i would need to do, as I registered them at the same time as Avartia does here. The difference is they read it from a JSON file and possibly do something else to make it compatible, but I'm not sure what.

commented

Also looking back now I can see you had shown me, which I really appreciate! I never actually saw it, as I guess Github isn't as good at auto-refreshing as I remember it being.
My main problem was that I wasn't sure if you meant a CraftTweaker event, an Avaritia Event, or just the Vanilla Minecraft event.

But again thanks for the examples shown anyways, and make sure to tell me if you can now use CraftTweaker how you wanted since I made it all be called during the Recipe event.

commented

I've always supported base Avaritia adding my recipes (whole reason I made this mod in the first place is cause they got removed when ported from 1.7.10!), and I've recently been working on more items to make this mod be more than just recipes. Things like Infinity-1 tools, and soon to be released Balanced versions of Infinity sword and armor with more things to come.

The only reason I wouldn't add crafttweaker support is due to the sheer amount of work/time it would take me. Wouldn't turn down a PR if someone else took the time to add it in but otherwise it probably won't be added.

commented

Nothing you can do, it was my mistake. The method is only available for normal crafting recipes, nothing that's from a separate mod's crafting. The only option is if you were to for example allow for exporting your recipes to a zen-script format but considering that might make people not use your mod, I doubt it's something you'd do.