DevOnTheRocks / RockyTweaks

A Minecraft Forge mod that adds additional functionality to other mods.
GNU General Public License v3.0
5 stars 2 forks source link

Multiple anvil recipes do not work. #33

Closed DiiioBrando closed 5 months ago

DiiioBrando commented 2 years ago

When I try to copy the above example, I get an error in the log:

mods.rockytweaks.Anvil.addRecipe(<minecraft:book>,
  [
    <minecraft:quartz> * 8,
    <minecraft:quartz> * 16,
    <minecraft:quartz> * 32
  ],
  [
    <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}),
    <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 2 as short, id: 16 as short}]}),
    <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 3 as short, id: 16 as short}]})
  ],
  [
    5,
    15,
    32
  ]
);

a method available but none matches the parameters (ZenTypeNative: crafttweaker.item.IItemStack, any[], any[], any[]) This is usually an error in your script, not in the mod addRecipe(ZenTypeNative: crafttweaker.item.IIngredient, ZenTypeNative: crafttweaker.item.IIngredient, ZenTypeNative: crafttweaker.item.IItemStack, int, Optional ZenTypeNative: crafttweaker.recipes.IRecipeFunction)

If I try to change the code and declare an array, then the error remains, the mismatch just changes:

val Quartz = [<minecraft:quartz> * 8, <minecraft:quartz> * 16, <minecraft:quartz> * 32] as IItemStack[];
val OSTROTA = [<minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}), <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 2 as short, id: 16 as short}]}), <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 3 as short, id: 16 as short}]})] as IItemStack[];
val llvvll = [5, 15, 32] as int[];
mods.rockytweaks.Anvil.addRecipe(<minecraft:book>, Quartz, OSTROTA, llvvll);

a method available but none matches the parameters (ZenTypeNative: crafttweaker.item.IItemStack, ZenTypeNative: crafttweaker.item.IItemStack[], ZenTypeNative: crafttweaker.item.IItemStack[], int[]) This is usually an error in your script, not in the mod addRecipe(ZenTypeNative: crafttweaker.item.IIngredient, ZenTypeNative: crafttweaker.item.IIngredient, ZenTypeNative: crafttweaker.item.IItemStack, int, Optional ZenTypeNative: crafttweaker.recipes.IRecipeFunction)

How to fix the problem?

I use forge-14.23.5.2859, CraftTweaker2-1.12-4.1.20.674, MTLib-3.0.7, rockytweaks-1.12.2-0.6.1.jar.

Mohron commented 2 years ago

The multiple recipes per declaration was removed in 0.6.0 in favor of support for ore dictionary and other advanced CraftTweaker features. Multiple recipes have to be declared separately.