Replace all of a type of recipe
supersaiyansubtlety opened this issue ยท 4 comments
Issue Description:
I'm trying to replace all slab, stair, and pressure plate recipes.
I can just make simple add/remove rules for pressure plates, but (because I'm using Vanilla Builders Extension) for slabs and stairs I need a way to programatically find and replace all recipes.
What happens:
I get errors.
What you expected to happen:
To not get errors.
Script used
Here is my attempt (slabs only atm): gist
crafttweaker.log file
Here's the crafttweaker.log with the errors I'm receiving.
I believe the relevant lines are 62-174.
Affected Versions (Do not use "latest"):
- Minecraft: 1.12.2
- Forge: 1.12.2 - 14.23.5.2847
- Crafttweaker: CraftTweaker2-1.12-4.1.19
- Using a server: no
Your most recent log file where the issue was present:
This is way out of scope to include in CraftTweaker itself.
You can ask in https://discord.blamejared.com and maybe someone there could guide you in making a script to do this, or can offer a premade script.
Ok, thanks
Edit:
Is this theoretically possible currently with crafttweaker, if a bit complex and convoluted?
In a purely theoretical sense, I think it's almost possible. Advisable is an entirely different matter, as is reasonable to implement. Also, note that no matter how you do it, the only way to know if the recipe output is a slab is to make assumptions - the name having the string slab
in it is a rudimentary and easily-broken one, checking if it's in some kind of slab<Material>
ore dictionary entry is another that may well fail if the mod author didn't bother or just forgot, things like that. From CT, it is (AFAICT) not possible to conclusively determine if something is a slab. You could maybe try doing recipe analysis, like checking the shape and the number of distinct ingredients, and by compounding checks you could be reasonably sure that it's probably a slab, but you're always going to be reliant on at least one convention being followed in order to avoid both false positives (not a slab but your script thinks it is) and false negatives (is a slab but your script doesn't realise) in your recipe tests.
Bottom line: it's almost but not quite possible to do it, but you can sorta fake it if you don't mind the results being imperfect.