CraftTweaker

CraftTweaker

151M Downloads

Issue with adding recipie for frames from thrmal expansion mod

Azzmurr opened this issue ยท 2 comments

commented

Issue Description:

When i try to add new recipie for thrmal expansion frames, crafttweaker say`s :
"Error executing {[0:crafttweaker]: script.zs}: For input string: "machine""

What happens:

Can`t add a recipie for any frame from thermal expansion mod in crafttweaker

What you expected to happen:

Create a new for any frame from thermal expansion

Script used : https://pastebin.com/PV42b0EG

Minetweaker.log file : https://pastebin.com/j4eyYx21


Affected Versions :

  • Minecraft: 1.12.2
  • Forge: 1.12.2-14.23.1.2555
  • Crafttweaker: 4.0.12

Your most recent log file where the issue was present:

[pastebin/gist/etc link here]

commented

You know that your indexes are kinda of?
You can't use a map's key to address an Array's position, since in your case, one is a String, while the other is an int.

Example:

for w, frame in frames {
    // remove
    recipes.remove(frame);
    // addShaped
    recipes.addShaped( frame, [
        [ ingots.steel, blocks.IC2Glass, ingots.steel ],
        [ blocks.IC2Glass, gearsForFrames[w], blocks.IC2Glass ],
        [ ingots.steel, blocks.IC2Glass, ingots.steel ]
    ] );
}

You are using the map key-Value iterator.
This iterator is giving w the keys of your maps, so it is of type String.
gearsForFrames on the other hand, is an IItemStack[]. These are indexed by integers.
There is a conversion between them but only if java can parse them which is not possible for a string like machine

commented

Sorry, i`m idiot.
You can close this