Cannot cast IItemStack[] to IIngredient[]
friendlyhj opened this issue ยท 4 comments
Issue description
I tried adding a rune altar recipe. All inputs are IItemStack
s. Then it introduced an error: Cannot cast IItemStack[] to IIngredient[]
. If I cast one of input to IIngredient
, it works well. However, IItemStack extends IIngredient
, the error is unreasonable.
Steps to reproduce
- Install Botania 1.16.5-416 and Mythic Botany
- Run the script below
- Get error
Script used
https://gist.github.com/friendlyhj/61a105c88602914791ac7a4ba6aa34de
The crafttweaker.log file
https://gist.github.com/friendlyhj/61a105c88602914791ac7a4ba6aa34de
Minecraft version
1.16
Forge version
36.1.0
CraftTweaker version
7.1.0.355
Other relevant information
No response
The latest.log file
No need to give, I think.
So I cloned botania (So using VazkiiMods/Botania@f7f6c00) and I'm unable to reproduce, it seems to be working as intended.
You are using Botania 1.16.5-416
and I believe they made some changes in newer versions, could you try a new version and see if it worked?
Also this is the script I tested with
import mods.botania.RuneAltar;
<recipetype:botania:runic_altar>.addRecipe("aura_ring_greatest",
<item:minecraft:dirt>,
5000000,
<item:botania:aura_ring_greater>,
<item:minecraft:diamond>,
<item:botania:rune_mana>,
<item:botania:rune_mana>,
<item:botania:life_essence>,
<item:botania:life_essence>,
<item:botania:life_essence>,
<item:botania:life_essence>);
Well, I updated botania and crafttweaker.
<recipetype:botania:runic_altar>.addRecipe("aura_ring_greatest",
<item:mythicbotany:aura_ring_greatest>,
5000000,
<item:botania:aura_ring_greater>,
<item:mythicbotany:alfsteel_ingot>,
<item:botania:rune_mana>,
<item:botania:rune_mana>,
<item:botania:life_essence>,
<item:botania:life_essence>,
<item:botania:life_essence>,
<item:botania:life_essence>);
Using varargs, it worked. But if I used array...
<recipetype:botania:runic_altar>.addRecipe("aura_ring_greatest",
<item:mythicbotany:aura_ring_greatest>,
5000000,
[<item:botania:aura_ring_greater>,
<item:mythicbotany:alfsteel_ingot>,
<item:botania:rune_mana>,
<item:botania:rune_mana>,
<item:botania:life_essence>,
<item:botania:life_essence>,
<item:botania:life_essence>,
<item:botania:life_essence>]);
It wouldn't work. It still complained error shown in the title.
This should be fixed by ZenCodeLang/ZenCode#48
I believe this was fixed by ZenCodeLang/ZenCode#71