Skip to content

Instantly share code, notes, and snippets.

@anabsolutesloth
Last active June 12, 2022 00:56
Show Gist options
  • Save anabsolutesloth/78b151af587aa9d3c5e25b8ff76e012b to your computer and use it in GitHub Desktop.
Save anabsolutesloth/78b151af587aa9d3c5e25b8ff76e012b to your computer and use it in GitHub Desktop.
Crafttweaker/ZenScript that will generate Tinkers' Tool Forges (and Armor Forges with ConArm!) for specified blocks.
import crafttweaker.item.IItemStack;
import crafttweaker.data.IData;
#ignoreBracketErrors
#Script by Emperdog
#To add blocks, do "ModID:ItemID" (Quotes are important to define it as a string), and the meta number of the block.
#EXAMPLE/BACKUP ["minecraft:planks" : 2]
var toolForgeBlocks = {
"minecraft:emerald_ore" : 0
} as string[IData];
var balancingingredient = null;
#Construct's Armory check
if (loadedMods has "conarm") {
print("[AllTheToolForges.zs} Construct's Armory is installed, creating Armor Forge recipes.");
} else {
print("[AllTheToolForges.zs] Construct's Armory is not installed, skipped Armor Forge creation.");
print("[AllTheToolForges.zs] Crafttweaker probably spit out a bunch of errors saying 'Could not resolve <conarm:armorforge>' above this, don't worry, everything still works.");
}
for blocks in toolForgeBlocks {
var itemstackblock = itemUtils.getItem(blocks, toolForgeBlocks[blocks]);
recipes.addShaped(<tconstruct:toolforge>.withTag({textureBlock: {id: blocks, Count: 1 as byte, Damage: toolForgeBlocks[blocks] as short}}), [[<ore:blockSeared>, <ore:blockSeared>, <ore:blockSeared>], [itemstackblock, <tconstruct:tooltables:3>, itemstackblock], [itemstackblock, balancingingredient, itemstackblock]]);
mods.jei.JEI.addItem(<tconstruct:toolforge>.withTag({textureBlock: {id: blocks, Count: 1 as byte, Damage: toolForgeBlocks[blocks] as short}}));
if (loadedMods has "conarm") {
recipes.addShaped(<conarm:armorforge>.withTag({textureBlock: {id: blocks, Count: 1 as byte, Damage: toolForgeBlocks[blocks] as short}}), [[<ore:blockSeared>, <ore:blockSeared>, <ore:blockSeared>], [itemstackblock, <conarm:armorstation>, itemstackblock], [itemstackblock, balancingingredient, itemstackblock]]);
mods.jei.JEI.addItem(<conarm:armorforge>.withTag({textureBlock: {id: blocks, Count: 1 as byte, Damage: toolForgeBlocks[blocks] as short}}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment