add formspec to filter
This commit is contained in:
parent
422f97507d
commit
474fa1bfb8
@ -17,6 +17,15 @@ minetest.register_node("digicontrol:filter", {
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {digicontrol = 1, dig_immediate = 2},
|
groups = {digicontrol = 1, dig_immediate = 2},
|
||||||
|
on_construct = function(pos)
|
||||||
|
minetest.get_meta(pos):set_string("formspec", "field[channel;Channel;${channel}]")
|
||||||
|
end,
|
||||||
|
on_receive_fields = function(pos, _, fields, sender)
|
||||||
|
if minetest.is_protected(pos, sender:get_player_name()) then return end
|
||||||
|
if fields.channel then
|
||||||
|
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||||
|
end
|
||||||
|
end,
|
||||||
digiline = {
|
digiline = {
|
||||||
semiconductor = {
|
semiconductor = {
|
||||||
rules = function(node, pos, from, channel)
|
rules = function(node, pos, from, channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user