2015-06-29 19:55:56 +02:00
-- Function that get the input/output rules of the delayer
local delayer_get_output_rules = function ( node )
2018-01-13 03:37:41 +01:00
local rules = { { x = - 1 , y = 0 , z = 0 , spread = true } }
2015-06-29 19:55:56 +02:00
for i = 0 , node.param2 do
2017-07-31 00:12:21 +02:00
rules = mesecon.rotate_rules_left ( rules )
2015-06-29 19:55:56 +02:00
end
return rules
end
local delayer_get_input_rules = function ( node )
2017-03-12 00:09:55 +01:00
local rules = { { x = 1 , y = 0 , z = 0 } }
2015-06-29 19:55:56 +02:00
for i = 0 , node.param2 do
2017-07-31 00:12:21 +02:00
rules = mesecon.rotate_rules_left ( rules )
2015-06-29 19:55:56 +02:00
end
return rules
end
2018-01-27 14:32:21 +01:00
-- Return the sides of a delayer.
-- Those are used to toggle the lock state.
local delayer_get_sides = function ( node )
local rules = {
{ x = 0 , y = 0 , z = - 1 } ,
{ x = 0 , y = 0 , z = 1 } ,
}
for i = 0 , node.param2 do
rules = mesecon.rotate_rules_left ( rules )
end
return rules
2018-01-27 05:17:22 +01:00
end
2018-01-27 15:00:58 +01:00
-- Make the repeater at pos try to lock any repeater it faces.
-- Returns true if a repeater was locked.
2018-01-27 06:01:49 +01:00
local check_lock_repeater = function ( pos , node )
2018-01-27 15:00:58 +01:00
-- Check the repeater at pos and look if it faces
-- a repeater placed sideways.
2018-01-27 06:01:49 +01:00
-- If yes, lock the second repeater.
2018-01-27 05:17:22 +01:00
local r = delayer_get_output_rules ( node ) [ 1 ]
local lpos = vector.add ( pos , r )
local lnode = minetest.get_node ( lpos )
local ldef = minetest.registered_nodes [ lnode.name ]
local g = minetest.get_item_group ( lnode.name , " redstone_repeater " )
if g >= 1 and g <= 4 then
local lrs = delayer_get_input_rules ( lnode )
local fail = false
for _ , lr in pairs ( lrs ) do
if lr.x == r.x or lr.z == r.z then
fail = true
break
end
end
if not fail then
minetest.swap_node ( lpos , { name = ldef.delayer_lockstate , param2 = lnode.param2 } )
2018-01-27 06:01:49 +01:00
return true
2018-01-27 05:17:22 +01:00
end
end
2018-01-27 06:01:49 +01:00
return false
2015-06-29 19:55:56 +02:00
end
2018-01-27 15:00:58 +01:00
-- Make the repeater at pos try to unlock any repeater it faces.
-- Returns true if a repeater was unlocked.
2018-01-27 06:01:49 +01:00
local check_unlock_repeater = function ( pos , node )
2018-01-27 15:00:58 +01:00
-- Check the repeater at pos and look if it faces
-- a repeater placed sideways.
-- If yes, also check if the second repeater doesn't receive
-- a locking signal on the other side. If not, unlock the second repeater.
2018-01-27 05:17:22 +01:00
local r = delayer_get_output_rules ( node ) [ 1 ]
local lpos = vector.add ( pos , r )
local lnode = minetest.get_node ( lpos )
local ldef = minetest.registered_nodes [ lnode.name ]
local g = minetest.get_item_group ( lnode.name , " redstone_repeater " )
2018-01-27 15:00:58 +01:00
-- Are we facing a locked repeater?
2018-01-27 05:17:22 +01:00
if g == 5 then
2018-01-27 15:00:58 +01:00
-- First check the orientation of the faced repeater
2018-01-27 05:17:22 +01:00
local lrs = delayer_get_input_rules ( lnode )
for _ , lr in pairs ( lrs ) do
if lr.x == r.x or lr.z == r.z then
2018-01-27 15:00:58 +01:00
-- Invalid orientation. Do nothing
return false
2018-01-27 05:17:22 +01:00
end
end
2018-01-27 15:00:58 +01:00
-- Now we check if there's a powered repeater on the other side of the
-- locked repeater.
-- To get to the other side, we just take another step in the direction which we already face.
local other_side = vector.add ( lpos , r )
local other_node = minetest.get_node ( other_side )
if minetest.get_item_group ( other_node.name , " redstone_repeater " ) ~= 0 and mesecon.is_receptor_on ( other_node.name ) then
-- Final check: The other repeater must also face the right way
local other_face = delayer_get_output_rules ( other_node ) [ 1 ]
local other_facing_pos = vector.add ( other_side , other_face )
if vector.equals ( other_facing_pos , lpos ) then
-- Powered repeater found AND it's facing the locked repeater. Do NOT unlock!
return false
2018-01-27 05:43:05 +01:00
end
2018-01-27 05:17:22 +01:00
end
2018-01-27 15:00:58 +01:00
if mesecon.is_powered ( lpos , delayer_get_input_rules ( lnode ) [ 1 ] ) then
minetest.swap_node ( lpos , { name = " mesecons_delayer:delayer_on_1 " , param2 = lnode.param2 } )
mesecon.queue : add_action ( lpos , " receptor_on " , { delayer_get_output_rules ( lnode ) } , ldef.delayer_time , nil )
else
minetest.swap_node ( lpos , { name = " mesecons_delayer:delayer_off_1 " , param2 = lnode.param2 } )
mesecon.queue : add_action ( lpos , " receptor_off " , { delayer_get_output_rules ( lnode ) } , ldef.delayer_time , nil )
end
return true
2018-01-27 05:17:22 +01:00
end
2018-01-27 06:01:49 +01:00
return false
end
-- Functions that are called after the delay time
local delayer_activate = function ( pos , node )
local def = minetest.registered_nodes [ node.name ]
local time = def.delayer_time
minetest.swap_node ( pos , { name = def.delayer_onstate , param2 = node.param2 } )
mesecon.queue : add_action ( pos , " receptor_on " , { delayer_get_output_rules ( node ) } , time , nil )
check_lock_repeater ( pos , node )
end
local delayer_deactivate = function ( pos , node )
local def = minetest.registered_nodes [ node.name ]
local time = def.delayer_time
minetest.swap_node ( pos , { name = def.delayer_offstate , param2 = node.param2 } )
mesecon.queue : add_action ( pos , " receptor_off " , { delayer_get_output_rules ( node ) } , time , nil )
check_unlock_repeater ( pos , node )
2015-06-29 19:55:56 +02:00
end
-- Register the 2 (states) x 4 (delay times) delayers
for i = 1 , 4 do
local groups = { }
if i == 1 then
2018-01-27 05:17:22 +01:00
groups = { dig_immediate = 3 , dig_by_water = 1 , destroy_by_lava_flow = 1 , dig_by_piston = 1 , attached_node = 1 , redstone_repeater = i }
2015-06-29 19:55:56 +02:00
else
2018-01-27 05:17:22 +01:00
groups = { dig_immediate = 3 , dig_by_water = 1 , destroy_by_lava_flow = 1 , dig_by_piston = 1 , attached_node = 1 , redstone_repeater = i , not_in_creative_inventory = 1 }
2015-06-29 19:55:56 +02:00
end
local delaytime
2017-03-11 23:29:46 +01:00
if i == 1 then delaytime = 0.1
elseif i == 2 then delaytime = 0.2
elseif i == 3 then delaytime = 0.3
elseif i == 4 then delaytime = 0.4
2015-06-29 19:55:56 +02:00
end
local boxes
if i == 1 then
boxes = {
{ - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } , -- the main slab
2017-03-12 00:09:55 +01:00
{ - 1 / 16 , - 6 / 16 , 6 / 16 , 1 / 16 , - 1 / 16 , 4 / 16 } , -- still torch
{ - 1 / 16 , - 6 / 16 , 0 / 16 , 1 / 16 , - 1 / 16 , 2 / 16 } , -- moved torch
2015-06-29 19:55:56 +02:00
}
elseif i == 2 then
boxes = {
{ - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } , -- the main slab
2017-03-12 00:09:55 +01:00
{ - 1 / 16 , - 6 / 16 , 6 / 16 , 1 / 16 , - 1 / 16 , 4 / 16 } , -- still torch
{ - 1 / 16 , - 6 / 16 , - 2 / 16 , 1 / 16 , - 1 / 16 , 0 / 16 } , -- moved torch
2015-06-29 19:55:56 +02:00
}
elseif i == 3 then
boxes = {
{ - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } , -- the main slab
2017-03-12 00:09:55 +01:00
{ - 1 / 16 , - 6 / 16 , 6 / 16 , 1 / 16 , - 1 / 16 , 4 / 16 } , -- still torch
{ - 1 / 16 , - 6 / 16 , - 4 / 16 , 1 / 16 , - 1 / 16 , - 2 / 16 } , -- moved torch
2015-06-29 19:55:56 +02:00
}
elseif i == 4 then
boxes = {
{ - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } , -- the main slab
2017-03-12 00:09:55 +01:00
{ - 1 / 16 , - 6 / 16 , 6 / 16 , 1 / 16 , - 1 / 16 , 4 / 16 } , -- still torch
{ - 1 / 16 , - 6 / 16 , - 6 / 16 , 1 / 16 , - 1 / 16 , - 4 / 16 } , -- moved torch
2015-06-29 19:55:56 +02:00
}
end
2018-01-27 14:32:21 +01:00
local help , longdesc , usagehelp , icon , on_construct
2017-03-12 00:17:10 +01:00
if i == 1 then
help = true
2017-03-11 23:28:22 +01:00
longdesc = " Redstone repeaters are versatile redstone components which delay redstone signals and only allow redstone signals to travel through one direction. The delay of the signal is indicated by the redstone torches and is between 0.1 and 0.4 seconds long. "
usagehelp = " To power a redstone repeater, send a signal in “arrow” direction. To change the delay, rightclick the redstone repeater. The delay is changed in steps of 0.1 seconds. "
2017-03-12 00:17:10 +01:00
icon = " mesecons_delayer_item.png "
2018-01-27 14:32:21 +01:00
on_construct = function ( pos )
local node = minetest.get_node ( pos )
local sides = delayer_get_sides ( node )
for s = 1 , # sides do
local spos = vector.add ( pos , sides [ s ] )
local snode = minetest.get_node ( spos )
local g = minetest.get_item_group ( snode.name , " redstone_repeater " )
local sdef = minetest.registered_nodes [ snode.name ]
if g ~= 0 and sdef.mesecons . receptor.state == mesecon.state . on then
if mesecon.is_powered ( pos , delayer_get_input_rules ( node ) [ 1 ] ) ~= false then
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_on_locked " , param2 = node.param2 } )
else
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_off_locked " , param2 = node.param2 } )
end
break
end
end
end
2017-03-12 00:17:10 +01:00
else
help = false
2017-03-11 23:28:22 +01:00
end
2017-12-05 14:09:39 +01:00
local on_rotate
if minetest.get_modpath ( " screwdriver " ) then
on_rotate = screwdriver.disallow
end
2018-01-27 14:32:21 +01:00
2015-06-29 19:55:56 +02:00
minetest.register_node ( " mesecons_delayer:delayer_off_ " .. tostring ( i ) , {
2017-01-04 06:20:13 +01:00
description = " Redstone Repeater " ,
2017-03-12 00:17:10 +01:00
inventory_image = icon ,
wield_image = icon ,
2017-03-11 23:28:22 +01:00
_doc_items_create_entry = help ,
_doc_items_longdesc = longdesc ,
_doc_items_usagehelp = usagehelp ,
2015-06-29 19:55:56 +02:00
drawtype = " nodebox " ,
tiles = {
" mesecons_delayer_off.png " ,
2017-06-05 18:40:56 +02:00
" mcl_stairs_stone_slab_top.png " ,
2017-03-12 00:09:55 +01:00
" mesecons_delayer_sides_off.png " ,
" mesecons_delayer_sides_off.png " ,
2015-06-29 19:55:56 +02:00
" mesecons_delayer_ends_off.png " ,
" mesecons_delayer_ends_off.png " ,
} ,
wield_image = " mesecons_delayer_off.png " ,
walkable = true ,
selection_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
2017-03-11 23:38:15 +01:00
collision_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
2015-06-29 19:55:56 +02:00
node_box = {
type = " fixed " ,
fixed = boxes
} ,
groups = groups ,
paramtype = " light " ,
paramtype2 = " facedir " ,
2017-03-12 00:54:16 +01:00
sunlight_propagates = false ,
2017-01-04 22:36:51 +01:00
is_ground_content = false ,
2015-06-29 19:55:56 +02:00
drop = ' mesecons_delayer:delayer_off_1 ' ,
2017-02-05 17:57:33 +01:00
on_rightclick = function ( pos , node )
2015-06-29 19:55:56 +02:00
if node.name == " mesecons_delayer:delayer_off_1 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_off_2 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
elseif node.name == " mesecons_delayer:delayer_off_2 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_off_3 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
elseif node.name == " mesecons_delayer:delayer_off_3 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_off_4 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
elseif node.name == " mesecons_delayer:delayer_off_4 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_off_1 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
end
end ,
2018-01-27 14:32:21 +01:00
on_construct = on_construct ,
2015-06-29 19:55:56 +02:00
delayer_time = delaytime ,
delayer_onstate = " mesecons_delayer:delayer_on_ " .. tostring ( i ) ,
2018-01-27 05:17:22 +01:00
delayer_lockstate = " mesecons_delayer:delayer_off_locked " ,
2017-02-11 18:46:23 +01:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2015-06-29 19:55:56 +02:00
mesecons = {
receptor =
{
state = mesecon.state . off ,
rules = delayer_get_output_rules
} ,
effector =
{
rules = delayer_get_input_rules ,
action_on = delayer_activate
}
2017-12-05 14:09:39 +01:00
} ,
on_rotate = on_rotate ,
2015-06-29 19:55:56 +02:00
} )
minetest.register_node ( " mesecons_delayer:delayer_on_ " .. tostring ( i ) , {
2017-03-12 00:09:55 +01:00
description = " Redstone Repeater (Powered) " ,
2017-03-02 19:53:53 +01:00
_doc_items_create_entry = false ,
2015-06-29 19:55:56 +02:00
drawtype = " nodebox " ,
tiles = {
" mesecons_delayer_on.png " ,
2017-06-05 18:40:56 +02:00
" mcl_stairs_stone_slab_top.png " ,
2017-03-12 00:09:55 +01:00
" mesecons_delayer_sides_on.png " ,
" mesecons_delayer_sides_on.png " ,
2015-06-29 19:55:56 +02:00
" mesecons_delayer_ends_on.png " ,
" mesecons_delayer_ends_on.png " ,
} ,
walkable = true ,
selection_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
2017-03-11 23:38:15 +01:00
collision_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
2015-06-29 19:55:56 +02:00
node_box = {
type = " fixed " ,
fixed = boxes
} ,
2018-01-27 05:17:22 +01:00
groups = { dig_immediate = 3 , dig_by_water = 1 , destroy_by_lava_flow = 1 , dig_by_piston = 1 , attached_node = 1 , redstone_repeater = i , not_in_creative_inventory = 1 } ,
2015-06-29 19:55:56 +02:00
paramtype = " light " ,
paramtype2 = " facedir " ,
2017-03-12 00:54:16 +01:00
sunlight_propagates = false ,
2017-01-04 22:36:51 +01:00
is_ground_content = false ,
2015-06-29 19:55:56 +02:00
drop = ' mesecons_delayer:delayer_off_1 ' ,
2017-02-05 17:57:33 +01:00
on_rightclick = function ( pos , node )
2015-06-29 19:55:56 +02:00
if node.name == " mesecons_delayer:delayer_on_1 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_on_2 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
elseif node.name == " mesecons_delayer:delayer_on_2 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_on_3 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
elseif node.name == " mesecons_delayer:delayer_on_3 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_on_4 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
elseif node.name == " mesecons_delayer:delayer_on_4 " then
2017-07-31 00:12:21 +02:00
minetest.swap_node ( pos , { name = " mesecons_delayer:delayer_on_1 " , param2 = node.param2 } )
2015-06-29 19:55:56 +02:00
end
end ,
2018-01-27 06:01:49 +01:00
after_dig_node = function ( pos , oldnode , oldmetadata , digger )
check_unlock_repeater ( pos , oldnode )
end ,
2015-06-29 19:55:56 +02:00
delayer_time = delaytime ,
delayer_offstate = " mesecons_delayer:delayer_off_ " .. tostring ( i ) ,
2018-01-27 05:17:22 +01:00
delayer_lockstate = " mesecons_delayer:delayer_on_locked " ,
2018-01-26 22:05:47 +01:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2015-06-29 19:55:56 +02:00
mesecons = {
receptor =
{
state = mesecon.state . on ,
rules = delayer_get_output_rules
} ,
effector =
{
rules = delayer_get_input_rules ,
action_off = delayer_deactivate
}
2017-12-05 14:09:39 +01:00
} ,
on_rotate = on_rotate ,
2015-06-29 19:55:56 +02:00
} )
2018-01-27 04:36:17 +01:00
2015-06-29 19:55:56 +02:00
end
2018-01-27 05:17:22 +01:00
-- Locked repeater
2018-01-27 04:36:17 +01:00
minetest.register_node ( " mesecons_delayer:delayer_off_locked " , {
description = " Redstone Repeater (Locked) " ,
inventory_image = icon ,
wield_image = icon ,
_doc_items_create_entry = false ,
drawtype = " nodebox " ,
-- FIXME: Textures of torch and the lock bar overlap. Nodeboxes are (sadly) not suitable for this.
-- So this needs to be turned into a mesh.
tiles = {
" mesecons_delayer_locked_off.png " ,
" mcl_stairs_stone_slab_top.png " ,
" mesecons_delayer_sides_locked_off.png " ,
2018-01-27 05:23:40 +01:00
" mesecons_delayer_sides_locked_off.png " ,
2018-01-27 04:36:17 +01:00
" mesecons_delayer_front_locked_off.png " ,
" mesecons_delayer_end_locked_off.png " ,
} ,
wield_image = " mesecons_delayer_locked_off.png " ,
walkable = true ,
selection_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
collision_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
node_box = {
type = " fixed " ,
fixed = {
{ - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } , -- the main slab
{ - 1 / 16 , - 6 / 16 , 6 / 16 , 1 / 16 , - 1 / 16 , 4 / 16 } , -- still torch
{ - 6 / 16 , - 6 / 16 , 0 / 16 , 6 / 16 , - 4 / 16 , 2 / 16 } , -- lock
}
} ,
2018-01-27 05:17:22 +01:00
groups = { dig_immediate = 3 , dig_by_water = 1 , destroy_by_lava_flow = 1 , dig_by_piston = 1 , attached_node = 1 , redstone_repeater = 5 , not_in_creative_inventory = 1 } ,
2018-01-27 04:36:17 +01:00
paramtype = " light " ,
paramtype2 = " facedir " ,
sunlight_propagates = false ,
is_ground_content = false ,
drop = ' mesecons_delayer:delayer_off_1 ' ,
2018-01-27 05:43:05 +01:00
delayer_time = 0.1 ,
2018-01-27 04:36:17 +01:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
mesecons = {
receptor =
{
state = mesecon.state . off ,
rules = delayer_get_output_rules
} ,
effector =
{
rules = delayer_get_input_rules ,
}
} ,
on_rotate = on_rotate ,
} )
minetest.register_node ( " mesecons_delayer:delayer_on_locked " , {
description = " Redstone Repeater (Locked, Powered) " ,
_doc_items_create_entry = false ,
drawtype = " nodebox " ,
tiles = {
" mesecons_delayer_locked_on.png " ,
" mcl_stairs_stone_slab_top.png " ,
" mesecons_delayer_sides_locked_on.png " ,
2018-01-27 05:23:40 +01:00
" mesecons_delayer_sides_locked_on.png " ,
2018-01-27 04:36:17 +01:00
" mesecons_delayer_front_locked_on.png " ,
" mesecons_delayer_end_locked_on.png " ,
} ,
walkable = true ,
selection_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
collision_box = {
type = " fixed " ,
fixed = { - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } ,
} ,
node_box = {
type = " fixed " ,
fixed = {
{ - 8 / 16 , - 8 / 16 , - 8 / 16 , 8 / 16 , - 6 / 16 , 8 / 16 } , -- the main slab
{ - 1 / 16 , - 6 / 16 , 6 / 16 , 1 / 16 , - 1 / 16 , 4 / 16 } , -- still torch
{ - 6 / 16 , - 6 / 16 , 0 / 16 , 6 / 16 , - 4 / 16 , 2 / 16 } , -- lock
}
} ,
2018-01-27 06:01:49 +01:00
after_dig_node = function ( pos , oldnode , oldmetadata , digger )
check_unlock_repeater ( pos , oldnode )
end ,
2018-01-27 05:17:22 +01:00
groups = { dig_immediate = 3 , dig_by_water = 1 , destroy_by_lava_flow = 1 , dig_by_piston = 1 , attached_node = 1 , redstone_repeater = 5 , not_in_creative_inventory = 1 } ,
2018-01-27 04:36:17 +01:00
paramtype = " light " ,
paramtype2 = " facedir " ,
sunlight_propagates = false ,
is_ground_content = false ,
drop = ' mesecons_delayer:delayer_off_1 ' ,
2018-01-27 05:43:05 +01:00
delayer_time = 0.1 ,
2018-01-27 04:36:17 +01:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
mesecons = {
receptor =
{
state = mesecon.state . on ,
rules = delayer_get_output_rules
} ,
effector =
{
rules = delayer_get_input_rules ,
}
} ,
on_rotate = on_rotate ,
} )
2015-06-29 19:55:56 +02:00
minetest.register_craft ( {
output = " mesecons_delayer:delayer_off_1 " ,
recipe = {
2017-02-08 01:44:07 +01:00
{ " mesecons_torch:mesecon_torch_on " , " mesecons:redstone " , " mesecons_torch:mesecon_torch_on " } ,
2017-01-31 23:32:56 +01:00
{ " mcl_core:stone " , " mcl_core:stone " , " mcl_core:stone " } ,
2015-06-29 19:55:56 +02:00
}
} )
2017-03-21 04:27:50 +01:00
-- Add entry aliases for the Help
if minetest.get_modpath ( " doc " ) then
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_off_2 " )
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_off_3 " )
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_off_4 " )
2018-01-27 04:36:17 +01:00
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_off_locked " )
2017-03-21 04:27:50 +01:00
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_on_1 " )
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_on_2 " )
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_on_3 " )
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_on_4 " )
2018-01-27 04:36:17 +01:00
doc.add_entry_alias ( " nodes " , " mesecons_delayer:delayer_off_1 " , " nodes " , " mesecons_delayer:delayer_on_locked " )
2017-03-21 04:27:50 +01:00
end