diff --git a/assets/opencomputers/recipes/default.recipes b/assets/opencomputers/recipes/default.recipes index 52c34e373..11228a796 100644 --- a/assets/opencomputers/recipes/default.recipes +++ b/assets/opencomputers/recipes/default.recipes @@ -67,13 +67,13 @@ wlanCard { } craftingUpgrade { - input: [[ingotIron, pistonBase, ingotIron] + input: [[ingotIron, craftingPiston, ingotIron] ["oc:circuitBasic", workbench, "oc:circuitBasic"] [ingotIron, "oc:craftingCircuitBoardPrinted", ingotIron]] } generatorUpgrade { input: [[ingotIron, "", ingotIron] - ["oc:circuitBasic", pistonBase, "oc:circuitBasic"] + ["oc:circuitBasic", craftingPiston, "oc:circuitBasic"] ["oc:craftingCircuitBoardPrinted", ingotIron, "oc:craftingCircuitBoardPrinted"]] } navigationUpgrade { @@ -83,12 +83,12 @@ navigationUpgrade { } signUpgrade { input: [[ingotIron, dyePowder, ingotIron] - ["oc:circuitAdvanced", stickWood, "oc:circuitAdvanced"] + ["oc:circuitBasic", stickWood, "oc:circuitBasic"] [ingotIron, pistonStickyBase, ingotIron]] } solarGeneratorUpgrade { input: [[glass, glass, glass] - ["oc:circuitAdvanced", "oc:craftingGenerator", "oc:circuitAdvanced"]] + ["oc:circuitElite", "oc:craftingGenerator", "oc:circuitElite"]] } nuggetIron { @@ -101,7 +101,7 @@ cuttingWire { } acid { type: shapeless - input: [bucketWater, sugar, slimeball, spiderEye, bone, {item=dyePowder, subID=1}] + input: [bucketWater, sugar, slimeball, fermentedSpiderEye, bone, {item=dyePowder, subID=1}] } disk { input: [["", nuggetIron, ""] diff --git a/assets/opencomputers/recipes/gregtech.recipes b/assets/opencomputers/recipes/gregtech.recipes index be468025f..21d2531dc 100644 --- a/assets/opencomputers/recipes/gregtech.recipes +++ b/assets/opencomputers/recipes/gregtech.recipes @@ -9,7 +9,7 @@ analyzer { ram1 { type:assembly - input: ["oc:circuitBasic", "oc:craftingCircuitBoardPrinted"] + input: [{item="oc:item",subID=24}, {item="oc:item",subID=32}] number:[3,3] eu:32 time=250 @@ -75,23 +75,22 @@ generatorUpgrade { ["oc:circuitAdvanced",craftingGenerator , "oc:circuitAdvanced"] [screwStainlessSteel, craftingToolScrewdriver, screwStainlessSteel]] } -#todo -#navigationUpgrade { -# input: [[ingotGold, compass, ingotGold] -# ["oc:circuitElite", {item=map, subID=32767}, "oc:circuitElite"] -# [ingotGold, potion, ingotGold]] -#} -#todo -#signUpgrade { -# input: [[ingotIron, dyePowder, ingotIron] -# ["oc:circuitAdvanced", stickWood, "oc:circuitAdvanced"] -# [ingotIron, pistonStickyBase, ingotIron]] -#} -#todo -#solarGeneratorUpgrade { -# input: [[glass, glass, glass] -# ["oc:circuitAdvanced", "oc:craftingGenerator", "oc:circuitAdvanced"]] -#} +navigationUpgrade { + input: [[craftingRawMachineTier02, compass, screwStainlessSteel] + ["oc:circuitElite", {item=map, subID=any}, "oc:circuitElite"] + [screwStainlessSteel, potion, craftingToolScrewdriver]] +} +signUpgrade { + input: [[screwAluminium, dyePowder, screwAluminium] + ["oc:circuitBasic", stickWood, "oc:circuitBasic"] + [screwAluminium, craftingToolScrewdriver, screwAluminium]] +} + +solarGeneratorUpgrade { + input: [[screwTitanium, "", screwTitanium] + ["oc:circuitElite", {item=GT_Components,subID=7} , "oc:circuitElite"] + [screwTitanium, craftingToolScrewdriver, screwTitanium]] +} cuttingWire { @@ -111,7 +110,7 @@ disk { transistor { type:assembly - input: [redstone, plateIron] + input: [redstone, {item="GT_Materials",subID=64}] number:[1,2] eu:16 time=500 @@ -136,7 +135,7 @@ chip2 { } chip3 { type:assembly - input: [{item=Components,subID=1}, {item="oc:item",subID=23}] + input: [{item=GT_Components,subID=1}, {item="oc:item",subID=23}] number:[1,16] eu:25 time=800 diff --git a/assets/opencomputers/recipes/user.recipes b/assets/opencomputers/recipes/user.recipes index 79b5d4581..d8a9b1457 100644 --- a/assets/opencomputers/recipes/user.recipes +++ b/assets/opencomputers/recipes/user.recipes @@ -4,7 +4,6 @@ # already known recipes). include file("default.recipes") -#include file("buildcraft.recipes") #include file("gregtech.recipes") #include file("your_custom.recipes") diff --git a/li/cil/oc/Recipes.scala b/li/cil/oc/Recipes.scala index 0525456c7..4f87085c6 100644 --- a/li/cil/oc/Recipes.scala +++ b/li/cil/oc/Recipes.scala @@ -5,6 +5,7 @@ import cpw.mods.fml.common.Loader import cpw.mods.fml.common.registry.GameRegistry import java.io.{FileReader, File} import java.util.logging.Level +import li.cil.oc.util.mods.GregTech import net.minecraft.block.Block import net.minecraft.item.crafting.FurnaceRecipes import net.minecraft.item.{ItemStack, Item} @@ -135,6 +136,7 @@ object Recipes { case "shaped" => addShapedRecipe(output, recipe) case "shapeless" => addShapelessRecipe(output, recipe) case "furnace" => addFurnaceRecipe(output, recipe) + case "assembly" => addAssemblyRecipe(output, recipe) case other => OpenComputers.log.warning("Failed adding recipe for '" + name + "', you will not be able to craft this item! The error was: Invalid recipe type '" + other + "'.") } } @@ -193,6 +195,46 @@ object Recipes { } } + private def addAssemblyRecipe(stack: ItemStack, recipe: Config) { + val input = recipe.getValue("input").unwrapped() match { + case list: java.util.List[Object] => list.map(parseIngredient) + case other => Seq(parseIngredient(other)) + } + val number = recipe.getValue("number").unwrapped().asInstanceOf[java.util.List[Object]] + var input1: ItemStack = null + var input2: ItemStack = null + if (input.size < 1 || input.size > 2) { + throw new RecipeException("Invalid recipe length: " + input.size + ".") + } + if (number.size() != input.size) { + throw new RecipeException("Invalid number length, expected: " + input.size + " got: " + number.size + ".") + } + + val eu = recipe.getValue("eu").unwrapped().asInstanceOf[Integer] + val duration = recipe.getValue("time").unwrapped().asInstanceOf[Integer] + val output = stack.copy() + output.stackSize = tryGetCount(recipe) + input(0) match { + case value: ItemStack => + input1 = value + input1.stackSize = number(0).asInstanceOf[Integer] + case other => throw new RecipeException("Invalid recipe type expected ItemStack got: " + other + ".") + } + + if (input.size == 2) { + input(1) match { + case value: ItemStack => + input2 = value + input2.stackSize = number(1).asInstanceOf[Integer] + case other => throw new RecipeException("Invalid recipe type expected ItemStack got: " + other + ".") + } + } + + if (input1 != null) { + GregTech.addAssemblerRecipe(input1, input2, output, duration, eu) + } + } + private def addFurnaceRecipe(stack: ItemStack, recipe: Config) { val input = parseIngredient(recipe.getValue("input").unwrapped()) @@ -253,7 +295,7 @@ object Recipes { } } } - case other => throw new RecipeException("Invalid ingredient type (not a map or string): "+other) + case other => throw new RecipeException("Invalid ingredient type (not a map or string): " + other) } private def itemNameEquals(item: Item, name: String) =