BluSunrize / ImmersiveEngineering

Wires, transformers, high voltage! Bzzzzt!
Other
782 stars 389 forks source link

[1.12.2] Mixer/Bottling Machine and Other Mods' Potions #3096

Closed TechnoMysterio closed 4 years ago

TechnoMysterio commented 6 years ago

A continuation of a previous post that didn't really go anywhere.

The mixer and bottling machine often play poorly with other mods that add or alter potions and their brewing recipes. The results vary from mod to mod, but here's a quick list of interactions from a selection of mods and their potions based on results in JEI and results from testing. I tested to see if I could mix their potions successfully, and to see if I could bottle them successfully:

Recent Testing:

CoFH Core: can mix, can't bottle
Inspirations: can mix, can't bottle
Quark: can mix, can bottle
Extra Alchemy: can't mix, can't bottle

From earlier testing, may have changed:

NetherEx: can mix, can't bottle
Cyclic: can mix, can bottle
Random Things: can mix, can bottle
Tough as Nails: can't mix, can't bottle

Another mod that alters the potion brewing mechanic is Better With Mods, with it's Hardcore Brewing system. This changes recipes for certain potions, and it also changes what is used to lengthen and strengthen potions, to use witch warts and brimstone instead of redstone and glowstone, respectively. I'm not sure how much of an effect this has, but with HCBrewing enabled I have noticed some odd behaviour, such as where I had a mixer with both water and some awkward potion in it, and applying a Magma Cream to make a fire resist potion results in the mixer making both fire resist potion and thick potion, as well occasions where the mixer won't accept the altered boosting reagents for other mods' potions. It does seem to mostly work however, so I'll leave it for now.

Here's something KnightMiner said relating to how the potion system is loaded that may provide some hints, in relation to IE and his own mod Inspirations:

By the looks of things, IE is registering the recipes to fill potions using fluids before init, meaning some mods (like inspirations) have not even added their potions yet. As for the actual crafting, it seems that is a dynamic recipe using the potion helper, meaning some mods (like TAN) that use the forge brewing registry are skipped.

The way I handle potion recipes in inspirations is basically the opposite. My recipe to bottle a potion from a fluid is dynamic, detecting the fluid to fill the bottle. I have static recipes for the individual potions which I fill in post init from both the potion helper and the forge brewing registry.

Apologies for the repost, but I felt it was worth trying to fix this issue, and I made sure to compile all the information I've found so far. Hopefully it's enough to solve the problem.

Versions: Forge: 14.23.4.2732 IE: 0.12-83 MC: 1.12.2

BluSunrize commented 6 years ago

Righto, I've managed to dig into this a bit (I previously lacked motivation to work on this btw., hence the neglect)

I'm gonna use this issue for me to put some notes down, so I actually know what the heck I'm doing:

Mixer:

CoFH potions (their recipes are done by Thermal Foundation btw) are mixable, because they use the vanilla MixPredicate class. So do Inspirations and Quark.

Extra Alchemy does custom Potion recipes using the aforementioned BrewingRecipeRegistry, which I can theoretically reverse-engineer to PotionTypes and as such, use. Tough As Nails seems to also use this registry

The general plan for me is to 1) handle those recipes 2) make my Mixer Recipes nicer (somehow) in order to have them more readable in JEI as well. I don't quite remember what stopped me from categorizing by output rather than input last time, but I'll try to fix that this time.

Bottling Machine:

Bottling is another beast. I don't think I want to do a dynamic recipe because anything dynamic is a pain in the butt for JEI integration. I'll definitely look at handling registration later, to account for custom potions being added late. I can't guarantee support for CoFH's fluid potions, because I haven't yet looked at how they do them and if I can interact with them easily.

TechnoMysterio commented 6 years ago

Despite my lack of programming knowledge, I do understand that potions and fluids generally in forge are something of a bugger to deal with, so I don't blame you for your reluctance to solve the problem.

Didn't look much into CoFH's fluid potions, since I didn't have Thermal Expansion installed to test its brewer, but I imagine that's a whole other can of worms to deal with. Or maybe a can of really angry wasps or something.

Actually, something I just thought of: can the mixer make splash and lingering potions? I can't remember.

BluSunrize commented 6 years ago

I might as well use this issue to log my progress a bit:

console log

We're off to a pretty solid start, I have potions categorizing by their output, which already vastly improves the display in JEI. So far using MixPredicates still. Next up is installing ExtraAlchemy and seeing if I can get theirs to work.

TechnoMysterio commented 6 years ago

Would it be wise to split the mixer's JEI page into two? So one for the standard mixing recipes like concrete, and another for the potion brewing recipes? Might help to break it up a bit, and it could be useful if someone wants to only see the normal recipes without the clutter from the brewing stuff.

BluSunrize commented 6 years ago

I did that with the Arc Furnace back in the day. Unfortunately that has become a lot more difficult to do, and also Mezz advised me not to. Each machine should have one handler.

TechnoMysterio commented 6 years ago

Can't seem to make splash potions in the mixer. Is this intentional?

BluSunrize commented 6 years ago

IE doesn't feature a splash potion fluid or anything like it.

TechnoMysterio commented 6 years ago

Fair enough, just curious.

KnightMiner commented 6 years ago

Inspirations handles splash potions by a crafting recipe for a splash potion bottle, would something like that make sense in IE?

BluSunrize commented 6 years ago

Yeah it would actually. I never really liked that particular "brewing" recipe in matters of sense. I'll take a look if I can put in some compat for Inspirations, and add the appropriate bottlign recipes ^_^

KnightMiner commented 6 years ago

I can actually oredict my bottles of you like, just so you don't need a hardcoded dependency. Maybe splashBottle and lingeringBottle? Would also let you add your own bottles without conflict so this works without Inspirations.

The other advantage to this method is you can add a "bottling" recipe using arrows to make tipped arrows, which can be a bit cheaper than potions to bottle.

BluSunrize commented 6 years ago

That might be an idea, yeah! Although I generally don't mind the dependencies, I has its compat modules for that.

TechnoMysterio commented 6 years ago

Gave the new update a try, and the mixer works well with most other potion mods. It doesn't work very well with Better with Mods' HCBrewing though, as potions can't be extended or strengthened using Witch Warts/Brimstone, nor redstone/glowstone. This isn't too much of a problem though, as HCBrewing can be disabled with no further issues, but I at least thought it was worth mentioning.

BluSunrize commented 6 years ago

I'll continue looking into further compat, including the oredicted bottles KnightMiner mentioned. I just wanted to get a build out today because I have 2 weeks of exams now and wanted this work off my desk.

I'll investigate compatability with Better with Mods once I have the time to work on IE again ^^

Also keeping this open for further reports/inspiration

Rickymakes-dev commented 6 years ago

Not sure if this is an already asked/solved question, but I been looking around and no one seems to have the proper answer for it. So I guess I will ask it here since it's regarding the bottling machine. I have been messing around with IE lately on FTB revelation 1.8.0 1.12, and it seems like glass bottle doesn't work with the bottle machine to fill it as a water bottle. I am aware of it's due to the change in the fluid registry in Minecraft Forge core mod, but my question is is there any way to get around that problem? Like a server config? I am building a factorio style potion factory, so I don't really want to use other bottlers like the one from IC2. Thank you in advance!

BluSunrize commented 6 years ago

Well, in an ideal world, we'd have a "Universal Bottles" mod, which adds bottles can can be filled with any fluid. Those would work with IE's bottling machine. Since such a mod doesn't exist, the next best thing would be for me to just add a recipe to the bottling machine that fills a bottle with water.

The fact that I haven't done that is mostly an oversight on my side. I'll keep it in mind for my next development phase.

TechnoMysterio commented 6 years ago

Not sure if it would be possible for you Rickymcraft, but could you just add a CraftTweaker recipe for the bottling machine that takes in an empty bottle and 250mb of water and outputs a water bottle?

Rickymakes-dev commented 6 years ago

@TechnoMysterio That seems to be a good fix for now, but despite the amount of time I spent on mod packs, I actually have never use MT/CT before. I know you have the create scripts in the scripts folder for the recipes/mod that you wanted to edit. But that is the extent of my knowledge on it, would you mind pointing me to some tutorial that aims toward IE specifically, I watched the one on nuclear craft, but that doesn't seem to help me out much. Any help would be hugely appreciated thank you!

Rickymakes-dev commented 6 years ago

@BluSunrize Thank you for the reply, able to contact the modder and have them reply immediately is really helpful and awesome! Thank you for putting in the work!

TechnoMysterio commented 6 years ago

Well the process of making a Crafttweaker script is pretty simple once you get it down. I'll try to give you a quick overview of making recipes, with adding a recipe for filling a bottle with water in the bottling machine as an example.

Firstly, you make a new txt file and rename the txt extension to zs, which is the script format used by Crafttweaker. Then you open the file up in a text editor of some kind, I use notepad++ myself. Then the real fun begins with making scripts. The syntax varies, but the site you'll want to visit is the Crafttweaker wiki, at: http://crafttweaker.readthedocs.io/en/latest/

From there you can look up what kind of recipe you need to make. If you want to make recipes for the bottling machine for instance, you have to find the bottling machine page. In the side bar on the left, click 'Mods', then 'Immersive Engineering', then 'Crafttweaker Support', and then 'Bottling Machine'. You should get to this page: http://crafttweaker.readthedocs.io/en/latest/#Mods/Immersive_Engineering/CraftTweaker_Support/Bottling_Machine/

That page gives you the necessary syntax for adding and removing recipes. You can use the 'Add Recipe' example as a guide and replace code where appropriate. For the bottling machine, the requirements for a functional recipe are, in order, an output item id, and input item id, and a fluid id. So if you want to have a recipe that outputs a water bottle from a glass bottle and 250mb of water, you'd do:

mods.immersiveengineering.BottlingMachine.addRecipe(<minecraft:potion>.withTag({Potion: "minecraft:water"}), <minecraft:glass_bottle>, <liquid:water>*250);

That may seem confusing, but I'll try to explain what it does. The first item, the output item, is a technically a potion bottle, but the potion in this case is just water. It's rather odd, but that's how the game does water bottles. I got the item id for a water bottle by using in-game commands provided by Crafttweaker, so I loaded up the game, got a water bottle in my hand and typed the command '/ct hand' in chat, which outputs the item id of the item you're currently holding. The input item is just a glass bottle, with the appropriate item id. The liquid id is set to be water, and the *250 after it means that it multiplies the input requirement by 250 so that the final recipe requires 250mb of water.

There are further tutorials on the Crafttweaker wiki if you need them. If all else fails, just copy the code I gave you into a .zs file, that should work. Hope this helps.

Euphemios commented 6 years ago

As this seems like the right place to say, when I try using mods.immersiveengineering.Mixer.removeRecipe(<liquid:potion>); it doesn't actually delete the recipe for any of the potions in the mixer, is that me doing something wrong or is it an actual bug?

drhaber commented 4 years ago

I'm having an issue with the Inspirations Compat. At one point in time inspiration's lingering and splash potion bottles were enabled as recipes within the bottler and then at an unknown point afterwards that seized to be the case I am running MC 1.12.2 and IE version 0.12-92 Additionally here is a paste bin of my mod list.

EDIT: I was able to get the recipes to show again by adding https://www.curseforge.com/minecraft/mc-mods/vials

Edit:edit: adding vials enabled the recipes to be visible in jei however when attempting to fill a splash bottle or lingering bottle neither ends up with any potion in them

Edit:edit:edit upon disabling Cofh:world Potions in its config and the recipes work but do not display in JEI