diff --git a/basic_machines/electronic_fab.lua b/basic_machines/electronic_fab.lua index e6a2640..1ef1934 100644 --- a/basic_machines/electronic_fab.lua +++ b/basic_machines/electronic_fab.lua @@ -77,8 +77,9 @@ local function making(pos, crd, nvm, inv) local owner = M(pos):get_string("owner") local rtype = RecipeType[crd.stage] local recipe = recipes.get(nvm, rtype, owner) - local output = ItemStack(recipe.output.name.." "..recipe.output.num) - if inv:room_for_item("dst", output) then + local output = ItemStack(recipe.output.name .. " " .. recipe.output.num) + local waste = recipe.waste and ItemStack(recipe.waste.name .. " " .. recipe.waste.num) + if inv:room_for_item("dst", output) and (not waste or inv:room_for_item("dst", waste)) then for _,item in ipairs(recipe.input) do local input = ItemStack(item.name.." "..item.num) if not inv:contains_item("src", input) then @@ -91,6 +92,9 @@ local function making(pos, crd, nvm, inv) inv:remove_item("src", input) end inv:add_item("dst", output) + if waste then + inv:add_item("dst", waste) + end crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS) return end diff --git a/items/electronic.lua b/items/electronic.lua index 1f54551..796fda5 100644 --- a/items/electronic.lua +++ b/items/electronic.lua @@ -51,11 +51,13 @@ minetest.register_craftitem("techage:ta5_aichip2", { techage.recipes.add("ta2_electronic_fab", { output = "techage:vacuum_tube 2", + waste = "basic_materials:empty_spool 1", input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"} }) techage.recipes.add("ta3_electronic_fab", { output = "techage:vacuum_tube 2", + waste = "basic_materials:empty_spool 1", input = {"default:glass 1", "basic_materials:copper_wire 1", "basic_materials:plastic_sheet 1", "techage:usmium_nuggets 1"} }) @@ -81,17 +83,20 @@ techage.recipes.add("ta4_electronic_fab", { techage.recipes.add("ta4_electronic_fab", { output = "techage:ta4_leds 8", + waste = "basic_materials:empty_spool 1", input = {"basic_materials:plastic_sheet 4", "basic_materials:copper_wire 1", "techage:ta4_silicon_wafer 1"} }) techage.recipes.add("ta4_electronic_fab", { output = "techage:ta5_aichip 2", + waste = "basic_materials:empty_spool 2", input = {"techage:ta4_leds 8", "basic_materials:copper_wire 1", "basic_materials:gold_wire 1", "techage:ta4_silicon_wafer 1"}, ex_points = 10, }) techage.recipes.add("ta4_electronic_fab", { output = "techage:ta5_aichip2 2", + waste = "basic_materials:empty_spool 2", input = {"techage:ta4_leds 8", "basic_materials:copper_wire 1", "basic_materials:gold_wire 1", "techage:ta4_silicon_wafer 1"}, ex_points = 50, })