Removing consecutive IE metal press recipes- ERROR: [crafttweaker]: Error executing {[0:crafttweaker]: Recipes\test.zs}: null
CelestialPhoenix opened this issue ยท 8 comments
When removing a set of consecutive items from the Immersive Engineering metal press, the last item from the set errors out and the remainder of the script does not load.
ERROR: [crafttweaker]: Error executing {[0:crafttweaker]: Recipes\test.zs}: null
is displayed in chat.
(the targeted press recipe shows as removed in JEI)
mods.immersiveengineering.MetalPress.removeRecipe(<thermalfoundation:material:295>);
produces the error.
extract from ContentTweaker log- https://pastebin.com/F2ESSFny
(full CT log is over 1400 lines long)
scripts for the other gear types are work perfectly fine.
mods.immersiveengineering.MetalPress.removeRecipe(<thermalfoundation:material:292>); mods.immersiveengineering.MetalPress.removeRecipe(<thermalfoundation:material:293>); mods.immersiveengineering.MetalPress.removeRecipe(<thermalfoundation:material:294>);
Same thing occurs when removing recipes for the IE wire items; steel wire errors out;
mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:23>);
while the previous recipes work ok;
mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:20>); mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:21>); mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:22>);
SkySom (from ContentTweaker/Team Acronym) stated 'it's all in IEs CraftTweaker handling which is in IE itself'
Versions & Modlist
Forge 14.23.2.2611
Immersive Engineering 0.12-78 (just tested with latest IE update)
Full modlist- https://docs.google.com/spreadsheets/d/1yTnDKD7qsu8KCYs17JFRDdhtQFbfn5lUK6M_49YW6SQ/edit?usp=sharing
#Name: Blood Sweat & Gears Vanilla.zs
#Author: PhoePhoe
print("Mwah ha ha ha ha ha");
mods.immersiveengineering.MetalPress.removeRecipe(<thermalfoundation:material:295>);
Yeah, thats the full test.zs
The full script is BS&G Thermal Foundation Materials.zs
Line 74 contains the same [currently disabled] script as the test.zs
https://gist.github.com/CelestialPhoenix/dfa46c0fc7c74b93d237dcd3d86e0b10
The plates removal (lines 13-16) worked perfectly fine.
Same error for IE wire removal (line 32)
https://gist.github.com/CelestialPhoenix/15e5f0c9e6ba7d12cf0b3d5043e17b4b
Try https://gist.github.com/CelestialPhoenix/15e5f0c9e6ba7d12cf0b3d5043e17b4b#gistcomment-2384337, and paste back any errors.
Put #norun
at the top of the BS&G Immersive Engineering.zs
& BS&G Thermal Foundation Materials.zs
before you restart.
on loading world
ERROR: Recipes\test.zs:64 > no such member in array: pressRemovals
ERROR: Recipes\test.zs:64 > No iterator with 2 variables
ERROR: [crafttweaker]: Error executing {[0:crafttweaker]: Recipes\test.zs}: null
on /ct syntax
[14:58:34] [main/INFO]: [CHAT] ERROR: Recipes\test.zs:64 > no such member in array: pressRemovals
[14:58:34] [main/INFO]: [CHAT] ERROR: Recipes\test.zs:64 > No iterator with 2 variables
#'d out lines 64 and 76 (enderium gear and steel wire); got the following on world load.
ERROR: Recipes\test.zs:66 > no such member in array: pressRemovals
ERROR: Recipes\test.zs:66 > No iterator with 2 variables
Also what are you using to write/format the .zs file? looks very tidy.
I use Notepad with a ZenScript Syntax Highlighter file from Curseforge. Try this now please. Also did you know you can Hide and Remove instead of adding a tooltip for the disabled items? Personally I do both. The Script should line up correctly when you paste it into a file.
import crafttweaker.item.IItemStack;
import mods.immersiveengineering.MetalPress;
// Name: Blood Sweat & Gears Thermal Foundation Ore Dict.zs
// Author: PhoePhoe & BookerTheGeek
print("There are no bodies buried into the foundations. You can stop looking now.");
print("Trust me I'm an engineer");
// Item Renaming
<immersiveengineering:material:20>.displayName= "Fine Copper Wire";
<immersiveengineering:material:21>.displayName= "Fine Electrum Wire";
<immersiveengineering:material:22>.displayName= "Fine Aluminium Wire";
<immersiveengineering:material:23>.displayName= "Fine Steel Wire";
// Tooltips
val myPlate = <immersiveengineering:metal>.definition;
for i in 30 to 40 {myPlate.makeStack(i).addTooltip("This item is disabled");}
<immersiveengineering:material:1>.addTooltip("This item is disabled");
<immersiveengineering:material:2>.addTooltip("This item is disabled");
<immersiveengineering:material:3>.addTooltip("This item is disabled");
// Ore Dictionary
<ore:stickIron>.remove(<immersiveengineering:material:1>);
<ore:stickSteel>.remove(<immersiveengineering:material:2>);
<ore:stickAluminum>.remove(<immersiveengineering:material:3>);
<ore:plateCopper>.remove(<immersiveengineering:metal:30>);
<ore:plateAluminum>.remove(<immersiveengineering:metal:31>);
<ore:plateLead>.remove(<immersiveengineering:metal:32>);
<ore:plateSilver>.remove(<immersiveengineering:metal:33>);
<ore:plateNickel>.remove(<immersiveengineering:metal:34>);
<ore:plateUranium>.remove(<immersiveengineering:metal:35>);
<ore:plateConstantan>.remove(<immersiveengineering:metal:36>);
<ore:plateSteel>.remove(<immersiveengineering:metal:38>);
<ore:plateGold>.remove(<immersiveengineering:metal:40>);
<ore:plateIron>.remove(<immersiveengineering:metal:39>);
// Storage Blocks
recipes.removeShaped(<thermalfoundation:storage:*>);
recipes.removeShaped(<thermalfoundation:storage_alloy:*>);
// Gears
var gearRemovals = [
<thermalfoundation:material:24>, # Iron
<thermalfoundation:material:25>, # Gold
<thermalfoundation:material:256>, # Copper
<thermalfoundation:material:257>, # Tin
<thermalfoundation:material:258>, # Silver
<thermalfoundation:material:259>, # Lead
<thermalfoundation:material:260>, # Aluminium
<thermalfoundation:material:261>, # Nickel
<thermalfoundation:material:262>, # Platinum
<thermalfoundation:material:263>, # Iridium
<thermalfoundation:material:264>, # Mithril
<thermalfoundation:material:288>, # Steel
<thermalfoundation:material:289>, # Electrum
<thermalfoundation:material:290>, # Invar
<thermalfoundation:material:291>, # Bronze
<thermalfoundation:material:292>, # Constantan
<thermalfoundation:material:293>, # Signaalum
<thermalfoundation:material:294>, # Lumium
<thermalfoundation:material:295>, # Enderium
] as IItemStack[];
for i, output in gearRemovals {
MetalPress.removeRecipe(output);
recipes.removeShaped(output);
}
// Wires
var wireRemovals = [
<immersiveengineering:material:20>, # Copper
<immersiveengineering:material:21>, # Electrum
<immersiveengineering:material:22>, # Aluminum
<immersiveengineering:material:23> # Steel
] as IItemStack[];
for i, output in wireRemovals {
MetalPress.removeRecipe(output);
recipes.removeShapeless(output);
}
// Rods
var rodRemovals = [
<immersiveengineering:material:1>, # Iron
<immersiveengineering:material:2>, # Steel
<immersiveengineering:material:3> # Aluminium
] as IItemStack[];
for i, output in rodRemovals {
MetalPress.removeRecipe(output);
recipes.removeShapeless(output);
}
// Heavy Plates
var hPlateRemovals = [
<thermalfoundation:material:328>, #
<thermalfoundation:material:357>, #
<thermalfoundation:material:358>, #
<thermalfoundation:material:359> #
] as IItemStack[];
for i, output in hPlateRemovals {
MetalPress.removeRecipe(output);
}
// Plates
val plateRemovals = <immersiveengineering:metal>.definition;
for i in 30 to 41 {MetalPress.removeRecipe(plateRemovals.makeStack(i));}
for i in 30 to 41 {recipes.remove(plateRemovals.makeStack(i));}
// Mechcomp Iron
// Mechcomp Steel
var gearsteel=<ore:gearSteel>;
var gearsmallsteel=<contenttweaker:gearsmallsteel>;
var ringsteel=<contenttweaker:ringsteel>;
var rodsteel=<contenttweaker:rodsteel>;
recipes.removeShaped(<immersiveengineering:material:9>);
recipes.addShaped(<immersiveengineering:material:9> * 2, [
[gearsmallsteel, rodsteel, ringsteel],
[gearsteel, rodsteel, gearsmallsteel],
[ringsteel, rodsteel, gearsteel]
]);
The only thing I get is
ERROR: [crafttweaker]: Error executing {[0:crafttweaker]: Recipes\test.zs}: null
on world load.
/ct syntax doesn't throw any errors.
I'm planning to remove/hide stuff later on. The tooltip is just a clarification on whats disabled, and so I can see what's available to reuse in other places.
Ok, figured it out, sorta. @BluSunrize if you pull every output for a specific mold, you get an ConcurrentModificationException
error message, and the script stops running. The easiest way to show this is to drop the following into your scrip folder.
var wireRemoval = [
<immersiveengineering:material:20>, # Copper
<immersiveengineering:material:21>, # Electrum
<immersiveengineering:material:22>, # Aluminum
<immersiveengineering:material:23> # Steel
] as IItemStack[];
for i, myOutput in wireRemoval {
mods.immersiveengineering.MetalPress.removeRecipe(myOutput);
}
It errors out the same if not in an array:
mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:20>); # Copper
mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:21>); # Electrum
mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:22>); # Aluminum
mods.immersiveengineering.MetalPress.removeRecipe(<immersiveengineering:material:23>); # Steel
Versions
- Minecraft 1.12.2
- Immersive Engineering 0.12-78
@CelestialPhoenix, Script is good (Both mine and yours) you will just need to either not empty the mould recipe, or if you are not wanting to use it at all then remove the recipe for the mould.
Moulds are made via the workbench/blueprints- so I've got this at the start of test.zs
mods.immersiveengineering.Blueprint.removeRecipe(<immersiveengineering:mold:1>); #gearmould
mods.immersiveengineering.Blueprint.removeRecipe(<immersiveengineering:mold:4>); #wiremould
Still throws the same error, though the moulds do not show as craftable in JEI.
I guess if a use is always needed; compacting sawdust into wooden gears/plates works and I could fine something to wiremould into string.