Additional type of item/fluid hatch - "Tool" or "Catalyst" hatches
MrEldritch opened this issue ยท 2 comments
Summary: Currently, we have 'inputs' and 'outputs' to our recipes. I am proposing an additional kind of "input/output" where special recipe prerequisites can be placed and then potentially be replaced by special outputs. A hole stuff goes into and out of. This allows for a (potentially quite large) class of operations that currently cannot be performed by Modular Machines, including some behavior that vanilla machines like the Brewing Stand already allow.
There are many types of recipes that use a 'catalyst' item that is degraded or drained during use - for instance, recipes that require a tool to craft which is slowly damaged over time (like TiCon's Chisel), or a number of machines which require 'components' which are damaged over time and can be repaired. (Such as Factory Tech's, which rather than power use "components" like gears and blades that are damaged and broken during operation). Alternatively, you could have something that is charged or filled or repaired over time.
Currently, these could only be simulated by taking the item in as an input, and then outputting a more damaged item as the output (I think the existing NBT stuff allows for this? Even if you couldn't just numerically subtract something from the damage meter every time, you could have an X% chance to swap it with one that was in another more damaged state, and just have the item go through a few discrete damage phases before it stopped working), which would mean that every single time you ran the crafting process, you'd have to take the now slightly-more-damaged catalyst and place it back in the input hatch.
It would be extremely handy to have a third class of hatch, which is neither an input nor an output - items that would be placed in it would stay in there, and if a recipe operated on them they would simply be replaced by the altered version that would remain in the hatch. You could specify that a recipe required a Gear item to be present in one of these special hatches, and had a 0.5% chance per recipe of replacing that gear with a Broken Gear or consuming it altogether. Or that a "CNC Machine" would perform certain operations if an End Mill tool was installed in one of these hatches, but other operations if a Cutting Blade tool was present there instead, and in either case would have a 50% chance of damaging it.
I'm currently thinking about the design of a salvage-based, post-apocalyptic-ish modpack, and being able to have machines wear out over time and allow broken machines to be repaired by replacing their components - which this would allow me to simulate - would be very useful. It would also be nice even just for stuff that could, technically, currently be handled just by setting certain items to be required but not consumed; for instance, stuff like the cooking implements in Harvestcraft that could just be thrown in an input hatch with the other ingredients, but which would really make more sense to go in a particular 'tools' box.
I don't really know what these should be called.
Potential enhancement of this idea:
This could also, potentially allow for 'batch processing' type machines, where instead of putting inputs in one end and getting outputs from the other end, you would put your inputs in, wait, and retrieve the outputs from the same inventory. This adds interesting wrinkles to automation! An perfect example machine that could be built this way would be the vanilla Brewing Stand, where water bottles are brewed with ingredients to become potion bottles in the same inventory slots. For our larger-scale Potion Brewery, we might instead have a fluid input/output hatch, and regular inputs in which we put RF and potion ingredients. Initially, we might fill the input/output hatch with water, place a sufficient amount of Nether Wart in the input to convert all of the water, and let the machine brew - after which we would instead have Awkward Potion in the input/output.
To enable this case, I suppose you'd want to make the hatches 'locked' so that you couldn't take anything in/out while the machine was running - say you had a "fermentation barrel" that took in fluid:juiceGrape and turned it over time into an equal amount of fluid:Wine. You wouldn't want to keep accepting grape juice after the recipe had started, because then where would it put the wine when it was finished if the tank was already full? Similar issues could also occur with item stacking in item hatches.
However, I think this would require more complicated logic - that "place a sufficient amount of Nether Wart in the input to convert all of the water" would immediately seem to require more complexity than just asking "are there the required inputs & space in the outputs to perform this recipe once", and it would seem to be hiding some potentially tricky edge cases - and so I'm not necessarily asking for this. Just the simpler form I described in the first paragraph would be entirely sufficient.