diff options
author | electrodude <electrodude@users.noreply.github.com> | 2016-06-11 20:14:38 -0400 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2016-06-11 17:14:38 -0700 |
commit | a1ed3acd7a7b65825b2faba4cc81dd42b249ba44 (patch) | |
tree | 6742cbb467020d88b48cb08eba8501f3634cb0f3 | |
parent | f76668969e69b1410d9fe1db07b4326cffdb58b0 (diff) | |
download | pipeworks-a1ed3acd7a7b65825b2faba4cc81dd42b249ba44.tar pipeworks-a1ed3acd7a7b65825b2faba4cc81dd42b249ba44.tar.gz pipeworks-a1ed3acd7a7b65825b2faba4cc81dd42b249ba44.tar.bz2 pipeworks-a1ed3acd7a7b65825b2faba4cc81dd42b249ba44.tar.xz pipeworks-a1ed3acd7a7b65825b2faba4cc81dd42b249ba44.zip |
Add digiline detector tube (#139)
* Add digiline detector tube
The digiline detector tube outputs an itemstring of every stack
that passes through it on the channel specified in its formspec.
* Don't store digiline detector tube's formspec in a temporary local
-rw-r--r-- | default_settings.txt | 3 | ||||
-rw-r--r-- | signal_tubes.lua | 49 | ||||
-rw-r--r-- | textures/pipeworks_digiline_detector_tube_end.png | bin | 0 -> 1068 bytes | |||
-rw-r--r-- | textures/pipeworks_digiline_detector_tube_inv.png | bin | 0 -> 765 bytes | |||
-rw-r--r-- | textures/pipeworks_digiline_detector_tube_noctr.png | bin | 0 -> 892 bytes | |||
-rw-r--r-- | textures/pipeworks_digiline_detector_tube_plain.png | bin | 0 -> 1500 bytes | |||
-rw-r--r-- | textures/pipeworks_digiline_detector_tube_short.png | bin | 0 -> 526 bytes |
7 files changed, 51 insertions, 1 deletions
diff --git a/default_settings.txt b/default_settings.txt index bbf02ce..41a3f7a 100644 --- a/default_settings.txt +++ b/default_settings.txt @@ -10,6 +10,7 @@ pipeworks.enable_pipe_devices = true pipeworks.enable_redefines = true pipeworks.enable_mese_tube = true pipeworks.enable_detector_tube = true +pipeworks.enable_digiline_detector_tube = true pipeworks.enable_conductor_tube = true pipeworks.enable_accelerator_tube = true pipeworks.enable_crossing_tube = true @@ -19,4 +20,4 @@ pipeworks.enable_one_way_tube = true pipeworks.enable_priority_tube = true pipeworks.enable_cyclic_mode = true -pipeworks.delete_item_on_clearobject = true
\ No newline at end of file +pipeworks.delete_item_on_clearobject = true diff --git a/signal_tubes.lua b/signal_tubes.lua index c7b61ec..dfd7649 100644 --- a/signal_tubes.lua +++ b/signal_tubes.lua @@ -67,6 +67,55 @@ if pipeworks.enable_detector_tube then }) end +if minetest.get_modpath("digilines") and pipeworks.enable_digiline_detector_tube then + pipeworks.register_tube("pipeworks:digiline_detector_tube", { + description = "Digiline Detecting Pneumatic Tube Segment", + inventory_image = "pipeworks_digiline_detector_tube_inv.png", + plain = { "pipeworks_digiline_detector_tube_plain.png" }, + node_def = { + tube = {can_go = function(pos, node, velocity, stack) + local meta = minetest.get_meta(pos) + + local setchan = meta:get_string("channel") + + digiline:receptor_send(pos, digiline.rules.default, setchan, stack:to_string()) + + return pipeworks.notvel(pipeworks.meseadjlist, velocity) + end}, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", + "size[8.6,2.2]".. + "field[0.6,0.6;8,1;channel;Channel:;${channel}]".. + "image[0.3,1.3;1,1;pipeworks_digiline_detector_tube_inv.png]".. + "label[1.6,1.2;Digiline Detecting Tube]" + ) + end, + on_receive_fields = function(pos, formname, fields, sender) + if fields.channel then + minetest.get_meta(pos):set_string("channel", fields.channel) + end + end, + groups = {}, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) end + } + }, + }, + }) + + minetest.register_craft( { + output = "pipeworks:digiline_detector_tube_1 2", + recipe = { + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, + { "digilines:wire_std_00000000", "mesecons_materials:silicon", "digilines:wire_std_00000000" }, + { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } + }, + }) +end + if pipeworks.enable_conductor_tube then pipeworks.register_tube("pipeworks:conductor_tube_off", { description = "Conducting Pneumatic Tube Segment", diff --git a/textures/pipeworks_digiline_detector_tube_end.png b/textures/pipeworks_digiline_detector_tube_end.png Binary files differnew file mode 100644 index 0000000..e9d01ba --- /dev/null +++ b/textures/pipeworks_digiline_detector_tube_end.png diff --git a/textures/pipeworks_digiline_detector_tube_inv.png b/textures/pipeworks_digiline_detector_tube_inv.png Binary files differnew file mode 100644 index 0000000..0ed763a --- /dev/null +++ b/textures/pipeworks_digiline_detector_tube_inv.png diff --git a/textures/pipeworks_digiline_detector_tube_noctr.png b/textures/pipeworks_digiline_detector_tube_noctr.png Binary files differnew file mode 100644 index 0000000..6f07886 --- /dev/null +++ b/textures/pipeworks_digiline_detector_tube_noctr.png diff --git a/textures/pipeworks_digiline_detector_tube_plain.png b/textures/pipeworks_digiline_detector_tube_plain.png Binary files differnew file mode 100644 index 0000000..86ded6f --- /dev/null +++ b/textures/pipeworks_digiline_detector_tube_plain.png diff --git a/textures/pipeworks_digiline_detector_tube_short.png b/textures/pipeworks_digiline_detector_tube_short.png Binary files differnew file mode 100644 index 0000000..6729c53 --- /dev/null +++ b/textures/pipeworks_digiline_detector_tube_short.png |