|
|
|
@ -74,6 +74,7 @@ local function autocraft(inventory, craft)
|
|
|
|
|
for i = 1, 9 do
|
|
|
|
|
inventory:add_item("dst", craft.decremented_input.items[i])
|
|
|
|
|
end
|
|
|
|
|
--minetest.log( "Autocrafted a " .. tostring(output) )
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -84,6 +85,9 @@ local function run_autocrafter(pos, elapsed)
|
|
|
|
|
local inventory = meta:get_inventory()
|
|
|
|
|
local craft = get_craft(pos, inventory)
|
|
|
|
|
local output_item = craft.output.item
|
|
|
|
|
|
|
|
|
|
--minetest.log( "[pipeworks]: running autocrafter at " .. tostring(pos) )
|
|
|
|
|
|
|
|
|
|
-- only use crafts that have an actual result
|
|
|
|
|
if output_item:is_empty() then
|
|
|
|
|
meta:set_string("infotext", S("unconfigured Autocrafter: unknown recipe"))
|
|
|
|
@ -107,6 +111,9 @@ local function start_crafter(pos)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
pipeworks.autocrafter = pipeworks.autocrafter or {}
|
|
|
|
|
pipeworks.autocrafter.run_autocrafter = run_autocrafter
|
|
|
|
|
|
|
|
|
|
local function after_inventory_change(pos)
|
|
|
|
|
start_crafter(pos)
|
|
|
|
|
end
|
|
|
|
@ -289,7 +296,7 @@ minetest.register_node("pipeworks:autocrafter", {
|
|
|
|
|
description = S("Autocrafter"),
|
|
|
|
|
drawtype = "normal",
|
|
|
|
|
tiles = {"pipeworks_autocrafter.png"},
|
|
|
|
|
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1, dig_generic = 1, axey=1, handy=1, pickaxey=1},
|
|
|
|
|
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1, dig_generic = 1, axey=1, handy=1, pickaxey=1, container=2},
|
|
|
|
|
_mcl_hardness=0.8,
|
|
|
|
|
tube = {insert_object = function(pos, node, stack, direction)
|
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
|