CraftTweaker

CraftTweaker

151M Downloads

recipes.removeShaped doesn't actually remove recipes!

Guinaro opened this issue ยท 3 comments

commented

Issue Description:

Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If you are using an unnofficial version of Minetweaker or Crafttweaker please report it to the person who gave you the version. Also please look at the other issues to make sure that you are not creating a duplicate.

What happens:

recipes.removeShaped() isn't working at all.
In my script see below: I'm using the recipes as reported by /ct recipes
(Also checked in JEI).
Removing shaped recipes cannot find the recipes, but they should exist. Or I get a report that it has deleted 1 or more recipes, but when checking in game the recipes are still present.
Also reporting the deletion of more than 1 recipes should be impossible as only 1 recipe per item is provided and has no wildcards!

E.g. In game recipe for minecraft:coal and <minecraft;diamond> still exists.

What you expected to happen:

Proper removal of the recipes, and no longer being present in JEI.

Script used: (using variations to check as many venues to try to getting removeShaped to work)

import crafttweaker.item.IIngredient;
var outputs = [minecraft:bone * 32, minecraft:cactus] as IIngredient[];
var inputs = [[[techreborn:uumatter, null, null], [techreborn:uumatter, techreborn:uumatter, null], [techreborn:uumatter, null, null]],[[null, techreborn:uumatter, null], [techreborn:uumatter, techreborn:uumatter, techreborn:uumatter], [techreborn:uumatter, null, techreborn:uumatter]]] as IIngredient[][][];

for i, output in outputs{
//print ("Output: " + output);
//print ("Input " + i + ": " + inputs[i]);
recipes.removeShaped(output, inputs[i]);
}
recipes.removeShaped(minecraft:clay_ball, [[techreborn:uumatter, techreborn:uumatter, null], [techreborn:uumatter, null, null], [techreborn:uumatter, techreborn:uumatter, null]]);
recipes.removeShaped(minecraft:coal, [[null, null, techreborn:uumatter], [techreborn:uumatter, null, null], [null, null, techreborn:uumatter]]);
recipes.removeShaped(minecraft:diamond, [[techreborn:uumatter, techreborn:uumatter, techreborn:uumatter], [techreborn:uumatter, techreborn:uumatter, techreborn:uumatter], [techreborn:uumatter, techreborn:uumatter, techreborn:uumatter]]);

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

Snippet out of log:
[POSTINITIALIZATION][CLIENT][INFO] Removing Shaped recipes for minecraft:bone * 32
[POSTINITIALIZATION][CLIENT][INFO] 0 removed
[POSTINITIALIZATION][CLIENT][INFO] Removing Shaped recipes for minecraft:cactus
[POSTINITIALIZATION][CLIENT][INFO] 0 removed
[POSTINITIALIZATION][CLIENT][INFO] Removing Shaped recipes for minecraft:clay_ball
[POSTINITIALIZATION][CLIENT][INFO] 0 removed
[POSTINITIALIZATION][CLIENT][INFO] Removing Shaped recipes for minecraft:coal
[POSTINITIALIZATION][CLIENT][INFO] 1 removed
[POSTINITIALIZATION][CLIENT][INFO] Removing Shaped recipes for minecraft:diamond
[POSTINITIALIZATION][CLIENT][INFO] 2 removed


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 14.23.2.2618
  • Crafttweaker: 1.12-4.1.4

Your most recent log file where the issue was present:

https://pastebin.com/8JMdZv0Y

commented

I saw that Crafttweaker 1.12-4.1.5 was available. So I retested. Issue remains.
Retested with following script (only change is removal of minecraft diamond with recipes.remove(). Which works. However: it is pointless to remove all recipes, as then I need to readd all of those that didn't need to be deleted. It may be a workaround, but certainly not desireable.

import crafttweaker.item.IIngredient;
var outputs = [<minecraft:bone> * 32, <minecraft:cactus>] as IIngredient[];
var inputs = [[[<techreborn:uumatter>, null, null], [<techreborn:uumatter>, <techreborn:uumatter>, null], [<techreborn:uumatter>, null, null]],[[null, <techreborn:uumatter>, null], [<techreborn:uumatter>, <techreborn:uumatter>, <techreborn:uumatter>], [<techreborn:uumatter>, null, <techreborn:uumatter>]]] as IIngredient[][][];

for i, output in outputs{
	//print ("Output: " + output);
	//print ("Input " + i + ": " + inputs[i]);
	recipes.removeShaped(output, inputs[i]);
}
recipes.removeShaped(<minecraft:clay_ball>, [[<techreborn:uumatter>, <techreborn:uumatter>, null], [<techreborn:uumatter>, null, null], [<techreborn:uumatter>, <techreborn:uumatter>, null]]);
recipes.removeShaped(<minecraft:coal>, [[null, null, <techreborn:uumatter>], [<techreborn:uumatter>, null, null], [null, null, <techreborn:uumatter>]]);
//recipes.removeShaped(<minecraft:diamond>, [[<techreborn:uumatter>, <techreborn:uumatter>, <techreborn:uumatter>], [<techreborn:uumatter>, <techreborn:uumatter>, <techreborn:uumatter>], [<techreborn:uumatter>, <techreborn:uumatter>, <techreborn:uumatter>]]);
recipes.remove(<minecraft:diamond>);
commented

Use the template. scripts and logs go on gist / pastebin.

commented

did you try using recipes.remove(<mod_name:item>); ?