Skip to content

Instantly share code, notes, and snippets.

@Sixdd6
Created May 6, 2018 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sixdd6/416ea5b0ac478ae47e6080af9d98a16e to your computer and use it in GitHub Desktop.
Save Sixdd6/416ea5b0ac478ae47e6080af9d98a16e to your computer and use it in GitHub Desktop.
import crafttweaker.item.IItemStack;
import crafttweaker.oredict.IOreDict;
// Create arrays by tool type
var pickaxes = [<minecraft:wooden_pickaxe>, <minecraft:stone_pickaxe>, <minecraft:iron_pickaxe>, <minecraft:golden_pickaxe>, <minecraft:diamond_pickaxe>, <mfsmod:copper_pickaxe>, <mfsmod:tin_pickaxe>, <mfsmod:bronze_pickaxe>, <mfsmod:aluminum_pickaxe>, <mfsmod:invar_pickaxe>, <mfsmod:steel_pickaxe>, <mfsmod:titanium_pickaxe>, <botania:manasteelpick>, <botania:elementiumpick>, <thaumcraft:thaumium_pick>, <thaumcraft:void_pick>] as IItemStack[];
var axes = [<minecraft:wooden_axe>, <minecraft:stone_axe>, <minecraft:iron_axe>, <minecraft:golden_axe>, <minecraft:diamond_axe>, <mfsmod:copper_axe>, <mfsmod:tin_axe>, <mfsmod:bronze_axe>, <mfsmod:aluminum_axe>, <mfsmod:invar_axe>, <mfsmod:steel_axe>, <mfsmod:titanium_axe>, <botania:manasteelaxe>, <botania:elementiumaxe>, <thaumcraft:thaumium_axe>, <thaumcraft:void_axe>] as IItemStack[];
var shovels = [<minecraft:wooden_shovel>, <minecraft:stone_shovel>, <minecraft:iron_shovel>, <minecraft:golden_shovel>, <minecraft:diamond_shovel>, <mfsmod:copper_shovel>, <mfsmod:tin_shovel>, <mfsmod:bronze_shovel>, <mfsmod:aluminum_shovel>, <mfsmod:invar_shovel>, <mfsmod:steel_shovel>, <mfsmod:titanium_shovel>, <botania:manasteelshovel>, <botania:elementiumshovel>, <thaumcraft:thaumium_shovel>, <thaumcraft:void_shovel>] as IItemStack[];
var swords = [<minecraft:wooden_sword>, <minecraft:stone_sword>, <minecraft:iron_sword>, <minecraft:golden_sword>, <minecraft:diamond_sword>, <mfsmod:copper_sword>, <mfsmod:tin_sword>, <mfsmod:bronze_sword>, <mfsmod:aluminum_sword>, <mfsmod:invar_sword>, <mfsmod:steel_sword>, <mfsmod:titanium_sword>, <botania:manasteelsword>, <botania:elementiumsword>, <thaumcraft:thaumium_sword>, <thaumcraft:void_sword>] as IItemStack[];
// Create array for repair materials
var mats = [<ore:plankWood>, <ore:cobblestone>, <ore:ingotIron>, <ore:ingotGold>, <ore:gemDiamond>, <ore:ingotCopper>, <ore:ingotCopper>, <ore:ingotBronze>, <ore:ingotAluminum>, <ore:ingotInvar>, <ore:ingotSteel>, <ore:ingotTitanium>, <ore:ingotManasteel>, <ore:ingotElementium>, <ore:ingotThaumium>, <ore:ingotVoid>];
// iterate through pickaxes and add recipe to repair pick with material from mats
for i, item in pickaxes {
val repairAmount = (item.maxDamage() / 2);
recipes.addShapeless(item.transformDamage(item.damage - repairAmount), [item.onlyDamaged(), mats[i]]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment