From c82a868de06ebd106669669afcbb5c2656ff6f9d Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 12 Sep 2016 22:35:23 +1000 Subject: [PATCH] added existing work --- depends.txt | 2 ++ init.lua | 57 +++++++++++++++++++++++++++++++++++++++++++++++ textures/t21.png | Bin 0 -> 778 bytes 3 files changed, 59 insertions(+) create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 textures/t21.png diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..2cec86e --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +default +digilines diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..7c6a0d4 --- /dev/null +++ b/init.lua @@ -0,0 +1,57 @@ +local function t21_digiline_receive(pos, node, channel, msg) + print(pos,node,channel,msg) +end + +minetest.register_node("test3d:t21", { + description = "T21 Execution Node", + tiles = { + { + image="t21.png", + animation={ + type = "vertical_frames", + aspect_w=16, + aspect_h=16, + length=18, + length=1.8, + }, + }, + }, + on_punch = function(pos, _, _, _) + local meta=minetest.get_meta(pos) + local cbeep = meta:get_int("test3d_running") +-- print("cbeep ",cbeep) + local nbeep=1 + if cbeep==1 then + nbeep=0 + else + nbeep=1 + end + meta:set_int("test3d_running",nbeep) + end, + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + digiline = { + receptor = {}, + effector = { + action = t21_digiline_receive + } + } +}) +minetest.register_abm({ + nodenames={"test3d:t21"}, + interval=1, + chance=1, + action = function(pos) + local node = minetest.get_node_or_nil(pos) + local meta = minetest.get_meta(pos) + local beepState = meta:get_int("test3d_running") + if beepState == nil then beepState=1 end +-- print(beepState) + if beepState == 1 then + minetest.sound_play("default_break_glass",{ + pos=pos, + max_hear_distance=100 + }) + end + end, +}) +print("Test3D loaded.") diff --git a/textures/t21.png b/textures/t21.png new file mode 100644 index 0000000000000000000000000000000000000000..e5bfed3840363a715966e6332eb1bec92a3d06c7 GIT binary patch literal 778 zcmV+l1NHogP)+v8?yE3yLO72OU8Q|lz<#VJq zAoSR2e^5#x#HcL!cn|pKE3M^Ua`mUYmeVeN+4jvp*TUfUmHy`;9i)0NdZ-!r^@u}{ zP(8xXBUX=e0f7fMkH#TWJ-CBZ4@HkS^hnhs3_U{iNJEc^9$Gy*2T%3T4pKer#eVM* zh90SUq@hO`d6*ScJsO8j^@ts0PJ7Ob9*iEQ5SZ$5l|A4gm>-ND`gJ{~=)ssDf*z(& zoa@m*Fh4SS2-Y8r9$GyVJs9f`L6402(K+UNgbsopg7rs652+sdvVv@ltJOo$BV+v` z=+QZ5=V=4M`h(F!uz$(bgI{LY9*C<)#{NangR%bT9CJNl2SE?T{-xyy5CVsr}2fETO+` z9)k5p#{ETx`60N!WUM~~J-GLC{YIYJ-(Il=&p%rKlF>u3{@~&M!dQO@dSvWh+Vc++ z^i!XIT-(|?Bcq34|H9~@!}>$fgRy@R^vL~rP%i}j