CraftTweaker

CraftTweaker

151M Downloads

【help】 recipe not recognized

mahoroa70 opened this issue · 11 comments

commented

Issue description

It is as the title.
I got the following error log.

[INITIALIZATION][CLIENT][ERROR] Recipe_Repair.zs:6 > 2 methods available but none matches the parameters (ZenTypeNative: crafttweaker.item.IItemStack, any[], function(any,any,any)any)

This sentence was the target, but I don't know what's wrong and I can't fix it.

import crafttweaker.item.IItemStack;

val repairableweponzero_one = [<kamenridercraft4th:attache_calibur>, <kamenridercraft4th:attache_shotgun>, <kamenridercraft4th:attache_arrow>, <kamenridercraft4th:authorise_buster>,<kamenridercraft4th:progrise_hopper_blade>, <kamenridercraft4th:progrise_hopper_blade_naginata>, <kamenridercraft4th:thousand_jacker>, <kamenridercraft4th:shot_riser_gun>,<kamenridercraft4th:zaia_slashriser_sword>, <kamenridercraft4th:shot_abaddo_gun>, <kamenridercraft4th:slash_abaddo_sword>] as IItemStack[];

for counter, nowItem in repairableweponzero_one {
  recipes.addShapeless(nowItem, [repairableweponzero_one[counter].anyDamage().onlyDamaged().marked("source"), <kamenridercraft4th:hiden_metal>], function(output, input, crafting) {return input.source.withDamage(input.source.damage - 500);});

}

Is it bad to use items from other mods...
I would appreciate it if you could tell me.

※I don't know if it's correct because I'm using Google Translate to convert it into English. I'm sorry if I'm wrong.

Steps to reproduce

No response

Script used

https://gist.github.com/mahoroa70/4b4b44ce192b55bbc6f12cfb023f4dfa

The crafttweaker.log file

https://gist.github.com/mahoroa70/d0c6674a8a19d71ed500919ba520272e

Minecraft version

1.12

Modloader

Forge

Modloader version

1.12.2-14.23.5.2860

CraftTweaker version

2-1.12-4.1.20.680

Other relevant information

  1. CutAll v2.5.2
  2. DigAll v2.3.2
  3. MineAll v2.6.6
  4. RosettaEnchant v0.0.9
  5. StorageBox v3.2.0
  6. Uncrafting 1.8 beta6
  7. AkutoLib 3.0.1
  8. AppleSkin mc1.12 1.0.14
  9. BaseMetals 1.12 2.5.0 rc2.332
  10. BedrockLayer 1.11.2 v1.2.4
  11. BetterFps 1.4.8
  12. BrandonsCore 1.12.2 2.4.20.162 universal
  13. carryon 1.12.2 1.12.6.20
  14. ChickenChunks 1.12.2 2.4.2.74 universal
  15. CodeChickenLib 1.12.2 3.2.3.358 universal
  16. compactmachines3 1.12.2 3.0.18 b278
  17. Controlling 3.0.10
  18. CosmeticArmorReworked 1.12.2 v5a
  19. CraftTweaker2 1.12 4.1.20.680
  20. cxlibrary 1.12.1 1.6.1
  21. Draconic-Evolution 1.12.2 2.3.28.354 universal
  22. Durability+Show 1.12 5.0.0
  23. EnderCore 1.12.2 0.5.76
  24. EnderIO 1.12.2 5.3.70
  25. EnderIO conduits mekanism 1.12.2 5.3.70
  26. EnderIO endergy 1.12.2 5.3.70
  27. EnderIO zoo 1.12.2 5.3.70
  28. EnderStorage 1.12.2 2.4.6.137 universal
  29. ExtremeReactors 1.12.2 0.4.5.68
  30. Forgelin 1.8.4
  31. ForgeMultipart 1.12.2 2.6.2.83 universal
  32. ftb ultimine 1202.3.5
  33. FullscreenWindowed 1.12 1.6.0
  34. GunpowderLib 1.12.2 1.1
  35. industrialforegoing 1.12.2 1.12.13 237
  36. IntegrationForegoing 1.12.2 1.11
  37. InventoryTweaks 1.64+dev.151
  38. ironchest 1.12.2 7.0.72.847
  39. jei 1.12.2 4.16.1.302
  40. JEROreIntegration 1.12.2 1.1.0
  41. journeymap 1.12.2 5.7.1
  42. JustEnoughIDs 1.0.4 SNAPSHOT thin
  43. JustEnoughResources 1.12.2 0.9.2.60
  44. kamenridercraft4th 1.12.2 v.1.11.4
  45. keywizard 1.12.2 1.7.3
  46. Mekanism 1.12.2 9.8.3.390
  47. MekanismGenerators 1.12.2 9.8.3.390
  48. MekanismTools 1.12.2 9.8.3.390
  49. MineMenu 1.12.2 1.6.11 universal
  50. MineTweakerRecipeMaker 1.12.2 1.2.2.30
  51. MMDLib 1.12 1.0.0 rc2.36
  52. modtweaker 4.0.20.11
  53. MouseTweaks 2.10 mc1.12.2
  54. MrTJPCore 1.12.2 2.1.4.43 universal
  55. MTLib 3.0.7
  56. MultiPageChest 1.12 1.9.1
  57. NaturesCompass 1.12.2 1.8.5
  58. NetherPortalFix 1.12.1 5.3.17
  59. NoMoreRecipeConflict 0.13(1.12.2)
  60. OptiFine 1.12.2 HD U G5
  61. OreSpawn 1.12 3.3.1.179
  62. phosphor 1.12.2 0.2.6+build50 universal
  63. phosphor forge mc1.12.2 0.2.7 universal
  64. ProjectRed 1.12.2 4.9.4.120 Base
  65. ProjectRed 1.12.2 4.9.4.120 integration
  66. RebornCore 1.12.2 3.19.5 universal
  67. RebornStorage 1.12.2 3.3.4.1
  68. RedstoneFlux 1.12 2.1.1.1 universal
  69. refinedstorage 1.6.16
  70. refinedstorageaddons 0.4.5
  71. rsinfinitewireless 1.2
  72. SpawnChecker 2.7.7.137
  73. stellarfluidconduit 1.12.2 1.0.3
  74. tesla core lib 1.12.2 1.0.18
  75. theoneprobe 1.12 1.4.28
  76. torohealth 1.12.2 11
  77. VanillaFix 1.0.10 150
  78. WR CBE 1.12.2 2.3.2.33 universal
  79. zerocore 1.12.2 0.1.2.9

The latest.log file

https://gist.github.com/mahoroa70/8527777bbf1b4e200f3d113fa5a6717b

commented

Steps to reproduce

It can be reproduced by inserting the script used and the following MOD and starting it.

CraftTweaker2 1.12 4.1.20.680
kamenridercraft4th 1.12.2 v.1.11.4
modtweaker 4.0.20.11
MTLib 3.0.7

commented

Try adding a null as last parameter, for the RecipeAction.
Also, I'd recommend you use the version of the addShapeless that also takes in a recipe name.

So something like

for counter, item in repairableweponzero_one {
    recipes.addShapeless("repair_" + counter, item, [/*...*/], function(output, input, crafting) {/*...*/}, null);
}

I skipped the parts with /*...*/ to keep it simple, you already know what to put in there.

================

Apart from that, you may want to also check that you don't create items that have negative uses then, so maybe you want to use something like

output.withDamage(max(0, input.source.damage - 500));
commented

I'm sorry, I made a mistake.

commented

thank you kindlich Thanks to you, the error that the recipe itself is not loaded has disappeared.
But this time I got this error.

[INITIALIZATION][CLIENT][ERROR] [crafttweaker | SIDE_CLIENT]: Error parsing Recipe_Repair.zs:6 -- ; expected

What should I do with this error?

commented

Updating to crafttweaker2 1.12.2 4.1.20.681 didn't help

commented

Please upload your current script to gist.github.com

commented

Sorry, I forgot to give you the new script.
This.

commented
import crafttweaker.item.IItemStack;

val repairableweponzero_one = [<kamenridercraft4th:attache_calibur>, <kamenridercraft4th:attache_shotgun>, <kamenridercraft4th:attache_arrow>, <kamenridercraft4th:authorise_buster>,<kamenridercraft4th:progrise_hopper_blade>, <kamenridercraft4th:progrise_hopper_blade_naginata>, <kamenridercraft4th:thousand_jacker>, <kamenridercraft4th:shot_riser_gun>,<kamenridercraft4th:zaia_slashriser_sword>, <kamenridercraft4th:shot_abaddo_gun>, <kamenridercraft4th:slash_abaddo_sword>] as IItemStack[];

for counter, item in repairableweponzero_one {
    recipes.addShapeless("repair_zero_one_wepons" + counter, item, [
        repairableweponzero_one[counter].anyDamage().onlyDamaged().marked("source"), 
        <kamenridercraft4th:hiden_metal>
        ], 
        function(output, input, crafting) {
            return input.source.withDamage(max(0, input.source.damage - 500));
        }
    );
}

That should work with what you want.

commented

I'm sorry, when I copied and pasted this code and started it, the first problem revived.

[INITIALIZATION][CLIENT][ERROR] Recipe_Repair.zs:6 > 2 methods available but none matches the parameters (string, ZenTypeNative: crafttweaker.item.IItemStack, any[], function(any,any,any)any)

Here is the latest error log and script.

commented
import crafttweaker.item.IItemStack;

val repairableweponzero_one = [<kamenridercraft4th:attache_calibur>, <kamenridercraft4th:attache_shotgun>, <kamenridercraft4th:attache_arrow>, <kamenridercraft4th:authorise_buster>,<kamenridercraft4th:progrise_hopper_blade>, <kamenridercraft4th:progrise_hopper_blade_naginata>, <kamenridercraft4th:thousand_jacker>, <kamenridercraft4th:shot_riser_gun>,<kamenridercraft4th:zaia_slashriser_sword>, <kamenridercraft4th:shot_abaddo_gun>, <kamenridercraft4th:slash_abaddo_sword>] as IItemStack[];

for counter, item in repairableweponzero_one {
    recipes.addShapeless("repair_zero_one_wepons" + counter, item, [
        repairableweponzero_one[counter].anyDamage().onlyDamaged().marked("source"), 
        <kamenridercraft4th:hiden_metal>
        ], 
        function(output, input, crafting) {
            return input.source.withDamage(max(0, input.source.damage - 500));
        }, null
    );
}

try this?

commented
  • Certification of all weapons described
  • 500 health recovery
  • Inheriting enchantments
  • Cannot repair while not taking damage
    I have a script that meets all my requirements!
    Thanks to jaredlll08 and kindlich!
    thank you very much!