added existing work

This commit is contained in:
Izaya 2016-09-12 22:35:23 +10:00
parent 102238563c
commit c82a868de0
3 changed files with 59 additions and 0 deletions

2
depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
digilines

57
init.lua Normal file
View File

@ -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.")

BIN
textures/t21.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B