• 0

    posted a message on Crafttweaker error - array maps

    Hello im trying to make script for my modpack that changes recipes for Better With Mods machines and im using associative arrays (maps).

    And every time it gives me this error: java.lang.ArrayStoreException: crafttweaker.mc1120.oredict.MCOreDictEntry

    This is the code:

    import crafttweaker.item.IIngredient;
    import crafttweaker.item.IItemStack;
    import crafttweaker.oredict.IOreDict;
    import crafttweaker.oredict.IOreDictEntry;
    
    mods.betterwithmods.Mill.removeAll();
    mods.betterwithmods.Anvil.removeAll();
    mods.betterwithmods.Saw.removeAll();
    
    val MillStoneRecipes = {
    [<gregtech:meta_dust:1615>] : [<minecraft:wheat>],
    [<contenttweaker:corn_flour>] : [<ore:seedCorn>],
    [<minecraft:sugar>] : [<minecraft:reeds>],
    [<gregtech:meta_dust:1599>] : [<minecraft:stone>],
    [<betterwithmods:material:3> * 2] : [<betterwithmods:material:2>],
    [<primal:tannin_ground>] : [<primal:bark_oak>],
    [<plants2:generic:1>] : [<plants2:rubus_o>],
    [<plants2:generic:1>] : [<plants2:blackberry>],
    [<plants2:generic:1>] : [<minecraft:dye>],
    [<plants2:generic:4>] : [<minecraft:dye:15>],
    [<minecraft:dye:2>] : [<ore:plantGreen>],
    [<minecraft:dye:5>] : [<ore:plantPurple>],
    [<minecraft:dye:14>] : [<ore:plantOrange>],
    [<plants2:generic:4>] : [<ore:plantWhite>],
    [<minecraft:dye:9>] : [<ore:plantPink>],
    [<plants2:generic:2>] : [<ore:plantBlue>],
    [<minecraft:dye:1>] : [<ore:plantRed>],
    [<minecraft:dye:11>] : [<ore:plantYellow>],
    [<minecraft:dye:15> * 3] : [<minecraft:bone>]
    } as IIngredient[][IItemStack[]];
    
    val SawRecipes = {
    <minecraft:log> : [<minecraft:planks> * 4,<primal:bark_oak> * 4],
    <minecraft:log:2> : [<minecraft:planks:2> * 4,<primal:bark_oak> * 4],
    <minecraft:log2:1> : [<minecraft:planks:5> * 4,<primal:bark_oak> * 4],
    <totemic:cedar_log> : [<totemic:cedar_plank> * 4,<primal:bark_oak> * 4],
    <plants2:log_0:1> : [<plants2:planks:3> * 4,<primal:bark_oak> * 4],
    <plants2:log_0> : [<plants2:planks:2> * 4,<primal:bark_oak> * 4],
    <plants2:log_0:2> : [<plants2:planks:4> * 4,<primal:bark_oak> * 4],
    <minecraft:log:1> : [<minecraft:planks:1> * 4,<primal:bark_oak> * 4],
    <minecraft:log:3> : [<minecraft:planks:3> * 4,<primal:bark_oak> * 4],
    <minecraft:log2> : [<minecraft:planks:4> * 4,<primal:bark_oak> * 4],
    <plants2:log_0:3> : [<plants2:planks:5> * 4,<primal:bark_oak> * 4],
    <ore:plankWood> : [<minecraft:stick> * 4]
    } as IItemStack[][IIngredient];
    
    
    for key, value in MillStoneRecipes {
    	mods.betterwithmods.Mill.addRecipe(key, value);
    }
    
    for key, value in SawRecipes {
    	mods.betterwithmods.Saw.add(key, value);
    }

     and this is the crafttweaker.log error:

    [INITIALIZATION][CLIENT][INFO] [crafttweaker | SIDE_CLIENT]: Loading Script: {[0:crafttweaker]: age1\BetterWithMods.zs}
    [INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: age1\BetterWithMods.zs}: crafttweaker.mc1120.oredict.MCOreDictEntry
    java.lang.ArrayStoreException: crafttweaker.mc1120.oredict.MCOreDictEntry
    	at age1\BetterWithMods.__script__(age1\BetterWithMods.zs:49)
    	at __ZenMain__.run(age1\BetterWithMods)
    	at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:240)
    	at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:105)
    	at crafttweaker.mc1120.events.CommonEventHandler.registerRecipes(CommonEventHandler.java:71)
    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_448_CommonEventHandler_registerRecipes_Register.invoke(.dynamic)
    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
    	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:857)
    	at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:636)
    	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:747)
    	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
    	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535)
    	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
    	at net.minecraft.client.main.Main.main(SourceFile:123)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

     

    Can anyone help me what is the problem??

     

    Posted in: Modpacks
  • To post a comment, please or register a new account.