CraftTweaker

CraftTweaker

151M Downloads

[1.19.2] "No such symbol: removeAll" and compatibility loss

SuperFeda opened this issue ยท 4 comments

commented

Issue description

For my modpack, I need a balance between mods, which will be implemented with CraftTweaker. The usual craftingTable.remove(<item:minecraft:stick>); is not enough for me, because, this command only removes the recipe in the workbench. Which I don't need. After all, if I remove the recipe for workbench only, and then add my recipe in the same workbench. What sense of my complicated recipe will not be, because through mechanical crafter of mod Create, you can create the same object but for the old recipe creation.
And in order to fix this nuance, I went to the official wiki page, where at the very end found the line removeAll(String regex); (https://docs.blamejared.com/1.19/ru/tutorial/Recipes/RecipeManagers - link to that page). There it was! The solution to my problem - I thought. But there was no such thing. When entering the world or sending the command /reload chat, CT wrote to me, "No such symbol: removeAll".
Also, I need help with the code that just adds the recipe. In the code, I write it like this:

craftingTable.addShapedMirrored("wrench", <item:ad_astra:wrench> * 1, [
    [<item:ad_astra:desh_plate>, <item:minecraft:air>, <item:ad_astra:desh_plate>],
    [<item:minecraft:air>, <item:botania:mana_diamond>, <item:minecraft:air>],
    [<item:minecraft:air>, <item:ad_astra:desh_plate>, <item:minecraft:air>]
]);

And in this case, minecraft complains that "no compatible methods found!". What are the methods? What's wrong in my code?
(DeepL translate)

Steps to reproduce

No response

Script used

https://github.com/SuperPypok/CTlog/blob/main/CraftTweaker.zs

The crafttweaker.log file

https://github.com/SuperPypok/CTlog/blob/main/crafttweaker.log

Minecraft version

1.19

Modloader

Forge

Modloader version

43.2.3

CraftTweaker version

10.0.23

Other relevant information

No response

The latest.log file

https://raw.githubusercontent.com/SuperPypok/CTlog/main/latest.log

commented

removeAll() isn't a global method, it needs to be called on a recipe manager, and it removes all the recipes for that manager, for example:

craftingTable.removeAll();

removes all recipes from the crafting table.

What you actually want is:

recipes.remove(<item>);

https://docs.blamejared.com/1.19/en/vanilla/api/recipe/manager/GenericRecipesManager#remove

That will remove all recipes for the item where it can, no matter where the recipe is crafted.

As for your issue with the mirrored shaped recipes, read this page:
https://docs.blamejared.com/1.19/en/tutorial/Recipes/Crafting/MirroredShapedRecipes

The syntax changed in newer versions to define how a recipe is mirrored.

commented

removeAll() isn't a global method, it needs to be called on a recipe manager, and it removes all the recipes for that manager, for example:

craftingTable.removeAll();

removes all recipes from the crafting table.

What you actually want is:

recipes.remove(<item>);

https://docs.blamejared.com/1.19/en/vanilla/api/recipe/manager/GenericRecipesManager#remove

That will remove all recipes for the item where it can, no matter where the recipe is crafted.

As for your issue with the mirrored shaped recipes, read this page: https://docs.blamejared.com/1.19/en/tutorial/Recipes/Crafting/MirroredShapedRecipes

The syntax changed in newer versions to define how a recipe is mirrored.

Thank you! I solved this problem, but after that a second one appeared. Recipes that I add to the game don't appear immediately. I have to restart the game.
(/reload does not work.)

commented

according to your log file, REI is having issues with other mods, the issue is most likely related to that.

commented

Ohhhhh, ok.
Thanks!