Created
August 29, 2018 09:17
-
-
Save dredhorse/50e8bc4cf6ae569243574797f81692ec to your computer and use it in GitHub Desktop.
Crafttweaker Bad Local Variable Type in Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mods.artisanworktables.builder.RecipeBuilder; | |
import mods.artisanworktables.builder.Copy; | |
import crafttweaker.item.IItemStack; | |
// Blacksmith Worktable | |
// managing Tools | |
val BlacksmithRecipe = RecipeBuilder.get("blacksmith"); | |
var Tools = [ | |
"shovel", | |
"pickaxe", | |
"axe", | |
"sword", | |
"hoe" | |
] as string[]; | |
var artisanWorktableTools = [ | |
"artisans_hammer", | |
"artisans_mortar", | |
"artisans_pliers" | |
] as string[]; | |
var tinyProgressionTools = [ | |
"battle", | |
"spear", | |
"multi" | |
] as string[]; | |
var tinyProgressionNetherTools = [ | |
"axe", | |
"sword", | |
"pickaxe", | |
"hoe", | |
"spade" | |
] as string[]; | |
function createArtisanWorktableTools(tools as string[], metal as string) as string[] { | |
var artisan as string[]; | |
for tool in tools | |
{ | |
artisan+= "artisanworktables:recipe." + tool + "." + metal; | |
} | |
return artisan; | |
} | |
function createMinecraftTools(tools as string[], metal as string) as string[] { | |
var minecraft as string[]; | |
for tool in tools | |
{ | |
minecraft+= "minecraft:" + metal + "_" + tool; | |
} | |
return minecraft; | |
} | |
function createTinyProgressionTools(tools as string[], metal as string) as string[] { | |
var tp as string[]; | |
for tool in tools | |
{ | |
tp+= "tp:" + metal + "_" + tool; | |
} | |
return tp; | |
} | |
function createTinyProgressionNetherTools(tools as string[], metal as string) as string[] { | |
var tpn as string[]; | |
for tool in tools | |
{ | |
tpn+= "tp:nether_" + metal + "_" + tool; | |
} | |
return tpn; | |
} | |
function createRecipe(item as string, usage as int, lavaAmount as int) { | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, usage) | |
.setFluid(<liquid:lava> * lavaAmount) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var IronTools = [ | |
"minecraft:iron_shovel", | |
"minecraft:iron_pickaxe", | |
"minecraft:iron_axe", | |
"minecraft:iron_sword", | |
"minecraft:iron_hoe", | |
"animus:kama_iron", | |
"roots:iron_knife", | |
"roots:iron_hammer", | |
"tp:nether_iron_axe", | |
"tp:iron_battle", | |
"tp:iron_spear", | |
"tp:iron_multi", | |
"tp:nether_iron_sword", | |
"tp:nether_iron_pickaxe", | |
"tp:nether_iron_hoe", | |
"tp:nether_iron_spade", | |
"tc:ipade", | |
"tc:ipaxe", | |
"tc:isaxe", | |
"artisanworktables:recipe.artisans_hammer.iron", | |
"artisanworktables:recipe.artisans_mortar.iron", | |
"artisanworktables:recipe.artisans_pliers.iron", | |
"minecraft:bucket" | |
] as string[]; | |
for item in IronTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 10) | |
.setFluid(<liquid:lava> * 100) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var DiamondTools = [ | |
"minecraft:diamond_shovel", | |
"minecraft:diamond_pickaxe", | |
"minecraft:diamond_axe", | |
"minecraft:diamond_sword", | |
"minecraft:diamond_hoe", | |
"animus:kama_diamond", | |
"roots:diamond_knife", | |
"roots:diamond_hammer", | |
"tp:nether_diamond_axe", | |
"tp:diamond_battle", | |
"tp:diamond_spear", | |
"tp:diamond_multi", | |
"tp:nether_diamond_sword", | |
"tp:nether_diamond_pickaxe", | |
"tp:nether_diamond_hoe", | |
"tp:nether_diamond_spade", | |
"tc:dpade", | |
"tc:dpaxe", | |
"tc:dsaxe", | |
"artisanworktables:recipe.artisans_hammer.diamond", | |
"artisanworktables:recipe.artisans_mortar.diamond", | |
"artisanworktables:recipe.artisans_pliers.diamond" | |
] as string[]; | |
for item in DiamondTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var GoldTools = [ | |
"minecraft:gold_shovel", | |
"minecraft:gold_pickaxe", | |
"minecraft:gold_axe", | |
"minecraft:gold_sword", | |
"minecraft:gold_hoe", | |
"animus:kama_gold", | |
"roots:gold_knife", | |
"roots:gold_hammer", | |
"tp:nether_gold_axe", | |
"tp:gold_battle", | |
"tp:gold_spear", | |
"tp:gold_multi", | |
"tp:nether_gold_sword", | |
"tp:nether_gold_pickaxe", | |
"tp:nether_gold_hoe", | |
"tp:nether_gold_spade", | |
"tc:dpade", | |
"tc:dpaxe", | |
"tc:dsaxe", | |
"artisanworktables:recipe.artisans_hammer.gold", | |
"artisanworktables:recipe.artisans_mortar.gold", | |
"artisanworktables:recipe.artisans_pliers.gold", | |
"nex:golden_witherbone_sword", | |
"nex:golden_witherbone_pickaxe", | |
"nex:golden_witherbone_shovel", | |
"nex:golden_witherbone_axe", | |
"nex:golden_witherbone_hoe", | |
"nex:golden_witherbone_hammer" | |
] as string[]; | |
for item in GoldTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var CopperTools = [ | |
"artisanworktables:recipe.artisans_hammer.copper", | |
"artisanworktables:recipe.artisans_mortar.copper", | |
"artisanworktables:recipe.artisans_pliers.copper", | |
"embers:ingotcopper_pickaxe", | |
"embers:ingotcopper_axe", | |
"embers:ingotcopper_shovel", | |
"embers:ingotcopper_hoe", | |
"embers:ingotcopper_sword" | |
] as string[]; | |
for item in CopperTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var SilverTools = [ | |
"artisanworktables:recipe.artisans_hammer.silver", | |
"artisanworktables:recipe.artisans_mortar.silver", | |
"artisanworktables:recipe.artisans_pliers.silver", | |
"embers:ingotsilver_pickaxe", | |
"embers:ingotsilver_axe", | |
"embers:ingotsilver_shovel", | |
"embers:ingotsilver_hoe", | |
"embers:ingotsilver_sword" | |
] as string[]; | |
for item in SilverTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var LeadTools = [ | |
"artisanworktables:recipe.artisans_hammer.lead", | |
"artisanworktables:recipe.artisans_mortar.lead", | |
"artisanworktables:recipe.artisans_pliers.lead", | |
"embers:ingotlead_pickaxe", | |
"embers:ingotlead_axe", | |
"embers:ingotlead_shovel", | |
"embers:ingotlead_hoe", | |
"embers:ingotlead_sword" | |
] as string[]; | |
for item in LeadTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var DawnstoneTools = [ | |
"embers:ingotdawnstone_pickaxe", | |
"embers:ingotdawnstone_axe", | |
"embers:ingotdawnstone_shovel", | |
"embers:ingotdawnstone_hoe", | |
"embers:ingotdawnstone_sword" | |
] as string[]; | |
for item in DawnstoneTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var AluminumTools = [ | |
"artisanworktables:recipe.artisans_hammer.aluminum", | |
"artisanworktables:recipe.artisans_mortar.aluminum", | |
"artisanworktables:recipe.artisans_pliers.aluminum", | |
"embers:ingotaluminum_pickaxe", | |
"embers:ingotaluminum_axe", | |
"embers:ingotaluminum_shovel", | |
"embers:ingotaluminum_hoe", | |
"embers:ingotaluminum_sword" | |
] as string[]; | |
for item in AluminumTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var BronzeTools = [ | |
"artisanworktables:recipe.artisans_hammer.bronze", | |
"artisanworktables:recipe.artisans_mortar.bronze", | |
"artisanworktables:recipe.artisans_pliers.bronze", | |
"embers:ingotbronze_pickaxe", | |
"embers:ingotbronze_axe", | |
"embers:ingotbronze_shovel", | |
"embers:ingotbronze_hoe", | |
"embers:ingotbronze_sword" | |
] as string[]; | |
for item in BronzeTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var ElectrumTools = [ | |
"artisanworktables:recipe.artisans_hammer.electrum", | |
"artisanworktables:recipe.artisans_mortar.electrum", | |
"artisanworktables:recipe.artisans_pliers.electrum", | |
"embers:ingotelectrum_pickaxe_electrum", | |
"embers:ingotelectrum_axe_electrum", | |
"embers:ingotelectrum_shovel", | |
"embers:ingotelectrum_hoe", | |
"embers:ingotelectrum_sword" | |
] as string[]; | |
for item in ElectrumTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var NickelTools = [ | |
"artisanworktables:recipe.artisans_hammer.nickel", | |
"artisanworktables:recipe.artisans_mortar.nickel", | |
"artisanworktables:recipe.artisans_pliers.nickel", | |
"embers:ingotnickel_pickaxe", | |
"embers:ingotnickel_axe", | |
"embers:ingotnickel_shovel", | |
"embers:ingotnickel_hoe", | |
"embers:ingotnickel_sword" | |
] as string[]; | |
for item in NickelTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var TinTools = [ | |
"artisanworktables:recipe.artisans_hammer.tin", | |
"artisanworktables:recipe.artisans_mortar.tin", | |
"artisanworktables:recipe.artisans_pliers.tin", | |
"embers:ingottin_pickaxe", | |
"embers:ingottin_axe", | |
"embers:ingottin_shovel", | |
"embers:ingottin_hoe", | |
"embers:ingottin_sword" | |
] as string[]; | |
for item in TinTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var ObsidianTools = [ | |
"tp:obsidian_axe", | |
"tp:obsidian_battle", | |
"tp:obsidian_spear", | |
"tp:obsidian_multi", | |
"tp:obsidian_sword", | |
"tp:obsidian_pickaxe", | |
"tp:obsidian_hoe", | |
"tp:obsidian_spade" | |
] as string[]; | |
for item in ObsidianTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
var WubTools = [ | |
"tp:wub_axe", | |
"tp:wub_spear", | |
"tp:wub_multi", | |
"tp:wub_sword", | |
"tp:wub_pickaxe", | |
"tp:wub_hoe", | |
"tp:wub_spade", | |
"tp:wub_hammer" | |
] as string[]; | |
for item in WubTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 500) | |
.setFluid(<liquid:lava> * 500) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} | |
BlacksmithRecipe.setCopy( | |
Copy.byName("tp:nether_sword") | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.create(); | |
recipes.removeByRecipeName("tp:nether_sword"); | |
var EmeraldTools = [ | |
"tp:emerald_axe", | |
"tp:emerald_battle", | |
"tp:emerald_spear", | |
"tp:emerald_multi", | |
"tp:emerald_sword", | |
"tp:emerald_pickaxe", | |
"tp:emerald_hoe", | |
"tp:emerald_spade" | |
] as string[]; | |
for item in EmeraldTools{ | |
BlacksmithRecipe.setCopy( | |
Copy.byName(item) | |
) | |
.addTool(<ore:artisansHammer>, 50) | |
.setFluid(<liquid:lava> * 250) | |
.create(); | |
recipes.removeByRecipeName(item); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment