From a1ed3acd7a7b65825b2faba4cc81dd42b249ba44 Mon Sep 17 00:00:00 2001 From: electrodude Date: Sat, 11 Jun 2016 20:14:38 -0400 Subject: [PATCH] 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 --- default_settings.txt | 3 +- signal_tubes.lua | 49 ++++++++++++++++++ .../pipeworks_digiline_detector_tube_end.png | Bin 0 -> 1068 bytes .../pipeworks_digiline_detector_tube_inv.png | Bin 0 -> 765 bytes ...pipeworks_digiline_detector_tube_noctr.png | Bin 0 -> 892 bytes ...pipeworks_digiline_detector_tube_plain.png | Bin 0 -> 1500 bytes ...pipeworks_digiline_detector_tube_short.png | Bin 0 -> 526 bytes 7 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 textures/pipeworks_digiline_detector_tube_end.png create mode 100644 textures/pipeworks_digiline_detector_tube_inv.png create mode 100644 textures/pipeworks_digiline_detector_tube_noctr.png create mode 100644 textures/pipeworks_digiline_detector_tube_plain.png create mode 100644 textures/pipeworks_digiline_detector_tube_short.png 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 new file mode 100644 index 0000000000000000000000000000000000000000..e9d01bae4c895d88ab7b2d180c7801b32b726c19 GIT binary patch literal 1068 zcmV+{1k?M8P)^2dM&Pp9%LymL!PGd^#Bzo8wi8V}VEU2Aa z4;#u!dAFig`aU*%x#8VCwaU@hkfS3Xo`D}jfsJ4o^Whn&A|D$n$hncb0X9TXa$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<+BsYn;ZJoz^&2X)A~h v8u_j>((d=~wfT?Le}|twd>G+>O%ow3thOsh00000NkvXXu0mjf5n*=e literal 0 HcmV?d00001 diff --git a/textures/pipeworks_digiline_detector_tube_noctr.png b/textures/pipeworks_digiline_detector_tube_noctr.png new file mode 100644 index 0000000000000000000000000000000000000000..6f078863ad8536cccf35545ae01af85357d491ca GIT binary patch literal 892 zcmV-?1B3jDP)-F& zgQ7t$Dw<4fP3`{K=U6~9VkKpz&*5|NWW|Nrbul5r4Hssfz{G?753P`sTn{nf=pC&) zPPR&7!jCFC_Z+?H5EH}jKqup9D-|Y!Z#A8SqqVrlgwQ!h1&t@FVSouwt~q+5@j?}A zOenjcXHII3F)_NY>3ja=`IwMiNy6EB>uF4Qx+0EWQCk`lGT!sYBk(H{nDC;MKOTWP zbTOg4f(wQ1VM2Hn7dA@qxgVaRR4BycW)QndhheP4!O#_ZF4SQtqkCKGcp`#WdcyJU zbutGcgzKi9O*vU` zw&1!IXSbXz=~;5sjGj3s51dW8Zq8Z8$(+uN#)Rvh=qzYVx%88-Tk)BcuS@96=^Jy+ zioPYCHGLDVnbY@^qcuHquA0*Gz|oq%gll5@aykq8R$Q~B@0nJb<=Z0v?@*RyzS;jS z%4%2SRlx^!nbq5QUDZ``c>Ooq98e`MZRz>%?Iv8DivGq z%>OG;Bk7NX6ynZ9e6u5430G-<5ClP_0__M_iX|7Sk#c?MTgr_**BQ!aI0~%L4?R97 z+=2_QHv$u`yW~P4ZA=8-o<_pE>?Xp5H7aS8yxZv!Cc-$SwczA!;9b>8YvWNfQey{ah5{$6k}rOmh_~Q%Ep9LkI$SX z)XKrcD9mScW;CA39fb*BAINAu(OHB;Obmx54|L|Va-}h$-HL?HBdu&~VItIPPNuY8 z{Qwh|`@%^|Yvl+`NS*O+N~5qWOaxxVyOhRW2AFWZ@3@d_i3#QBTu5EXr~U_J>fxan SDlsbn0000< literal 0 HcmV?d00001 diff --git a/textures/pipeworks_digiline_detector_tube_plain.png b/textures/pipeworks_digiline_detector_tube_plain.png new file mode 100644 index 0000000000000000000000000000000000000000..86ded6f9e00b20f7c196deccd7596c10211d84f3 GIT binary patch literal 1500 zcmV<21ta>2P)Cf>sHv%`s;a81tE;T6tgWrBuCA`H zudlGMu(7eRva+(Xv$M3cw6(Rhwzjsnx3{>sxVgExy1Kf%ySu!+yuH1>zP`S{zrVo1 zz`?=6!otGC!^6bH#KpzM#>U3S$H&OX$jQmc%F4>i%gfBn%+1Zs&d$!y&(F}%(9zM+ z($dn?)6>+{)YaA1*4Eb7*VowC*xA|H+S=OO+}z&Y-r(Ti;o;%t=H`cAS8V_Q00DGT zPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskIMF-#n z5)vshF*E@c000CdNklToR z4=#XNO-F=fj9D|T7>LjepEb9Z#p6C1Rm-Yr+R0I|p<8yX*05{EQd-JLKc&)XNls^F zMNa3GT+XbYRZP2aqPY#z(5l9nT`y|KxYlRQE<2XhaLoFtdFs|R$2O(SY&xaL86};S zo+(mR&ZZRAG#%9~=~m^qUeq*4t=4VL=KHYQy&K=$PDky*c;elAeb1lxl6>&4u)BG% zvr~Av_vii}J8xv^+h}q#oX`Eg`?tO6^lloM-wp|R{ODO~i#3N*hR7L@7?98=AZ7Ll zykzNpI!ok&gaNS@D{TU@a!BAemJSq|g(fRaVqI3c1TxAiLfgdlvkD7+Rz4HECgB>$ z$pu0?#CD`S3oQ~l#Lii10y*h5kxdr%(ph31RtCg6L|Oz+fV{Lz^Hzth%FBRr&do4JngX6j{!t zQ%^HFC7nJoEvupGE$1)SDw|GOGd1nhK>JXsS1e7pY^UhDZryV2s-|b8Y2*V|mdtvo?5Z`VX7D&oAG7A`k%kCezh=$YtRTWQ?g+G58XVOT zp_V-Y9!pcZjEGvJN2p8ezGxsquiO#p5gTeJh;WQKp&qe`TS0_+G$qm^a04UTM1)hF z5or_X!PqJyqT~)(>4AUQKtxIRNa*2N6-1cU#T6@UW>ysu<=Uu4q($J0QPo0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