diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-02-27 11:29:02 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-02-27 11:29:02 -0500 |
commit | e04cee42cc3aedfd31de963be1022b1be4cd232e (patch) | |
tree | 1623b37252f2fba8868fe66b7eefd069a29737d4 | |
parent | 1770573a8f612c8337618272c19a81a1074e5f1e (diff) | |
download | dreambuilder_modpack-e04cee42cc3aedfd31de963be1022b1be4cd232e.tar dreambuilder_modpack-e04cee42cc3aedfd31de963be1022b1be4cd232e.tar.gz dreambuilder_modpack-e04cee42cc3aedfd31de963be1022b1be4cd232e.tar.bz2 dreambuilder_modpack-e04cee42cc3aedfd31de963be1022b1be4cd232e.tar.xz dreambuilder_modpack-e04cee42cc3aedfd31de963be1022b1be4cd232e.zip |
update pipeworks and homedecor
-rw-r--r-- | building_blocks/init.lua | 1 | ||||
-rw-r--r-- | pipeworks/autocrafter.lua | 53 |
2 files changed, 47 insertions, 7 deletions
diff --git a/building_blocks/init.lua b/building_blocks/init.lua index c8c6f64..3c83cb4 100644 --- a/building_blocks/init.lua +++ b/building_blocks/init.lua @@ -341,6 +341,7 @@ if minetest.get_modpath("moreblocks") then end minetest.unregister_item("moreblocks:tar") + minetest.register_alias("moreblocks:tar", "building_blocks:Tar") stairsplus:register_all( "building_blocks", diff --git a/pipeworks/autocrafter.lua b/pipeworks/autocrafter.lua index faf5381..738f3f2 100644 --- a/pipeworks/autocrafter.lua +++ b/pipeworks/autocrafter.lua @@ -102,6 +102,7 @@ local function after_recipe_change(pos, inventory) minetest.get_node_timer(pos):stop() autocrafterCache[minetest.hash_node_position(pos)] = nil meta:set_string("infotext", "unconfigured Autocrafter") + inventory:set_stack("output", 1, "") return end local recipe_changed = false @@ -171,26 +172,29 @@ end local function update_meta(meta, enabled) local state = enabled and "on" or "off" meta:set_int("enabled", enabled and 1 or 0) - meta:set_string("formspec", - "size[8,11]".. + local fs = "size[8,12]".. "list[context;recipe;0,0;3,3;]".. "image[3,1;1,1;gui_hb_bg.png^[colorize:#141318:255]".. "list[context;output;3,1;1,1;]".. "image_button[3,2;1,1;pipeworks_button_" .. state .. ".png;" .. state .. ";;;false;pipeworks_button_interm.png]" .. - "list[context;src;0,3.5;8,3;]".. + "list[context;src;0,4.5;8,3;]".. "list[context;dst;4,0;4,3;]".. default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - default.get_hotbar_bg(0,7) .. - "list[current_player;main;0,7;8,4;]" .. + default.get_hotbar_bg(0,8) .. + "list[current_player;main;0,8;8,4;]" .. "listring[current_player;main]".. "listring[context;src]" .. "listring[context;dst]" .. "listring[current_player;main]".. "listring[context;recipe]" .. "listring[context;output]" - ) + if minetest.get_modpath("digilines") then + fs = fs.."field[1,3.5;4,1;channel;Channel;${channel}]" + fs = fs.."button_exit[5,3.2;2,1;save;Save]" + end + meta:set_string("formspec",fs) -- toggling the button doesn't quite call for running a recipe change check -- so instead we run a minimal version for infotext setting only @@ -282,6 +286,8 @@ minetest.register_node("pipeworks:autocrafter", { if update_meta(meta, true) then start_crafter(pos) end + elseif fields.save then + meta:set_string("channel",fields.channel) end end, can_dig = function(pos, player) @@ -362,7 +368,40 @@ minetest.register_node("pipeworks:autocrafter", { after_inventory_change(pos) return count end, - on_timer = run_autocrafter + on_timer = run_autocrafter, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if channel ~= meta:get_string("channel") then return end + if type(msg) == "table" then + if #msg < 3 then return end + local inv = meta:get_inventory() + for y=0,2,1 do + for x=1,3,1 do + local slot = y*3+x + if minetest.registered_items[msg[y+1][x]] then + inv:set_stack("recipe",slot,ItemStack(msg[y+1][x])) + else + inv:set_stack("recipe",slot,ItemStack("")) + end + end + end + after_recipe_change(pos,inv) + elseif msg == "off" then + update_meta(meta, false) + minetest.get_node_timer(pos):stop() + elseif msg == "on" then + if update_meta(meta, true) then + start_crafter(pos) + end + elseif msg == "single" then + run_autocrafter(pos,1) + end + end, + }, + }, }) minetest.register_craft( { |