From f79194c419e5302c121c51c20a7f61706d9a071e Mon Sep 17 00:00:00 2001 From: Johannes Lohrer Date: Sat, 28 Dec 2013 19:31:40 +0100 Subject: [PATCH 1/3] completed recipes --- assets/opencomputers/recipes/default.recipes | 8 ++--- assets/opencomputers/recipes/gregtech.recipes | 33 +++++++++---------- li/cil/oc/Recipes.scala | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/assets/opencomputers/recipes/default.recipes b/assets/opencomputers/recipes/default.recipes index 52c34e373..154e5afe2 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 { diff --git a/assets/opencomputers/recipes/gregtech.recipes b/assets/opencomputers/recipes/gregtech.recipes index be468025f..ba5826ef2 100644 --- a/assets/opencomputers/recipes/gregtech.recipes +++ b/assets/opencomputers/recipes/gregtech.recipes @@ -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=tile.GT_Components,subID=7} , "oc:circuitElite"] + [screwTitanium, craftingToolScrewdriver, screwTitanium]] +} cuttingWire { diff --git a/li/cil/oc/Recipes.scala b/li/cil/oc/Recipes.scala index 2275872f8..f076551a0 100644 --- a/li/cil/oc/Recipes.scala +++ b/li/cil/oc/Recipes.scala @@ -248,7 +248,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) = From 55d34d156481ad88469ed8907860244c873eca6c Mon Sep 17 00:00:00 2001 From: Johannes Lohrer Date: Sat, 28 Dec 2013 20:50:12 +0100 Subject: [PATCH 2/3] added assembly recipes --- assets/opencomputers/recipes/default.recipes | 2 +- assets/opencomputers/recipes/gregtech.recipes | 8 ++-- li/cil/oc/Recipes.scala | 45 +++++++++++++++++++ 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/assets/opencomputers/recipes/default.recipes b/assets/opencomputers/recipes/default.recipes index 154e5afe2..11228a796 100644 --- a/assets/opencomputers/recipes/default.recipes +++ b/assets/opencomputers/recipes/default.recipes @@ -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 ba5826ef2..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 @@ -88,7 +88,7 @@ signUpgrade { solarGeneratorUpgrade { input: [[screwTitanium, "", screwTitanium] - ["oc:circuitElite", {item=tile.GT_Components,subID=7} , "oc:circuitElite"] + ["oc:circuitElite", {item=GT_Components,subID=7} , "oc:circuitElite"] [screwTitanium, craftingToolScrewdriver, screwTitanium]] } @@ -110,7 +110,7 @@ disk { transistor { type:assembly - input: [redstone, plateIron] + input: [redstone, {item="GT_Materials",subID=64}] number:[1,2] eu:16 time=500 @@ -135,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/li/cil/oc/Recipes.scala b/li/cil/oc/Recipes.scala index f076551a0..8c14dfbae 100644 --- a/li/cil/oc/Recipes.scala +++ b/li/cil/oc/Recipes.scala @@ -13,6 +13,7 @@ import org.apache.commons.io.FileUtils import scala.Some import scala.collection.convert.wrapAsScala._ import scala.collection.mutable.ArrayBuffer +import li.cil.oc.util.mods.GregTech object Recipes { def init() { @@ -133,6 +134,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 => throw new RecipeException("Invalid recipe type '" + other + "'.") } } @@ -188,6 +190,49 @@ 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)) + } + var 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()) From be245b67397e7a6ff16bcc86dc0265b3710d4a3c Mon Sep 17 00:00:00 2001 From: Johannes Lohrer Date: Sat, 28 Dec 2013 20:58:43 +0100 Subject: [PATCH 3/3] removed buildcraft recipes from default --- assets/opencomputers/recipes/user.recipes | 1 - 1 file changed, 1 deletion(-) 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")