forked from Mirrorlandia_minetest/digistuff
Allow lights to be controlled by strings as well
This commit is contained in:
parent
ff236643af
commit
e23a308a1f
5
init.lua
5
init.lua
@ -1039,8 +1039,9 @@ for i=0,14,1 do
|
|||||||
action = function(pos,node,channel,msg)
|
action = function(pos,node,channel,msg)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if meta:get_string("channel") ~= channel then return end
|
if meta:get_string("channel") ~= channel then return end
|
||||||
if type(msg) ~= "number" or msg > 14 or msg < 0 then return end
|
local value = tonumber(msg)
|
||||||
node.name = "digistuff:light_"..math.floor(msg)
|
if (not value) or value > 14 or value < 0 then return end
|
||||||
|
node.name = "digistuff:light_"..math.floor(value)
|
||||||
minetest.swap_node(pos,node)
|
minetest.swap_node(pos,node)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user