CraftTweaker

CraftTweaker

151M Downloads

[Question] Adding in variants for potions

jjc54 opened this issue ยท 7 comments

commented

Issue Description:

I'm trying to add in recipes for 63 potions from Potion Core (https://minecraft.curseforge.com/projects/potion-core), which is completely possible using CraftTweaker's brewing recipe handler (https://crafttweaker.readthedocs.io/en/latest/#Vanilla/Recipes/Recipes_Brewing_Stand/#brewing-recipe-handler). However, for these 63 potions the mod also adds items for longer, stronger, splash, lingering, and tipped potions. I know I could manually write these in a script, but I feel there is a much easier way to do this using code that isn't listed on the wiki (And one that doesn't require me to write 700+ recipes).

Is this possible?

What happens:

I have to add 700+ recipes manually via scripts.

What you expected to happen:

There has to be a better way to implement these recipes using more advanced code that I don't know about.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

crafttweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

https://crafttweaker.readthedocs.io/en/latest/#Vanilla/Recipes/Recipes_Brewing_Stand/#brewing-recipe-handler


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: forge-14.23.3.2697
  • Crafttweaker: CraftTweaker2-1.12-4.1.8
  • Using a server: N/A
  • If yes, does the client have the exact same scripts?
    N/A

Your most recent log file where the issue was present:

N/A

commented

You can use loops to reduce the amount you actually have to write by hand.

commented

That works, thanks for the help!

commented

@whitestarx0312 just curious, do you have your scripts published anywhere? I'm trying to add the same potion recipes and would really love to piggyback off of your legwork if at all possible. :)

commented

@TimTinkers Yes! Please see https://pastebin.com/12M30A1f

The code is a bit of a mess, a lot of the potions have ingredients integrated with other mods, so you may need to replace them with whatever items you intend on using. It also includes recipe removals/replacements for potions from other mods like Extra Alchemy.

Good news is you should only need to change the base ingredient, the level II/extending/lingering/splash potion recipes are generic.

Hope this helps!

commented

@whitestarx0312 thank you so much for the quick response and taking the time to share this! I had to do a few replacements for ingredients present on my own server, but this saved me a ton of time.

commented

@TimTinkers Awesome, I'm happy I could help! Have fun!

commented

Hey, I found this via google and wanted to provide an alternative script, if anyone wants it. Mine is a good deal longer (~445 lines) but provides every recipe that vanilla would provide (Normal, Splash, Lingering, Long, Long Splash Direct, Long Splash Upgrade, Long Lingering Direct, Long Lingering Upgrade, etc etc) via loops and arrays.

Here it is: https://gist.github.com/katubug/b2b499375e0548b492fdc48bdc8ea401

Same disclaimers apply as with the previous script: it uses a handful of ingredients from my modlist. However, it ought to be easy enough to change them all, as everything is labeled etc. I also didn't make recipes for every single potion, as I am disabling some of them. But it should also be quite easy to add things on to the bottoms of the arrays, for the other ones. :)

Sorry for the necromancy, but this seemed like the best place to put it. If you have questions, or if I messed something up, you should be able to comment on the gist itself and I assume I get notified? Anyway thanks :D