mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 09:50:19 +01:00
Change field receipt handling to work properly with Minetest 0.4.8.
This commit is contained in:
parent
85f2f3f742
commit
e8d31c3e5a
@ -92,6 +92,9 @@ local after_place = function(pos, placer)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local receive_fields = function(pos, formname, fields, sender)
|
local receive_fields = function(pos, formname, fields, sender)
|
||||||
|
if fields.quit then
|
||||||
|
return
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if fields.nearest then
|
if fields.nearest then
|
||||||
initialize_data(meta, "@nearest", fields.command, fields.param)
|
initialize_data(meta, "@nearest", fields.command, fields.param)
|
||||||
|
@ -9,7 +9,10 @@ local object_detector_make_formspec = function (pos)
|
|||||||
"field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]")
|
"field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
local object_detector_on_receive_fields = function (pos, formname, fields)
|
local object_detector_on_receive_fields = function(pos, formname, fields)
|
||||||
|
if fields.quit then
|
||||||
|
return
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("scanname", fields.scanname)
|
meta:set_string("scanname", fields.scanname)
|
||||||
meta:set_string("digiline_channel", fields.digiline_channel)
|
meta:set_string("digiline_channel", fields.digiline_channel)
|
||||||
|
@ -488,6 +488,9 @@ minetest.register_node(nodename, {
|
|||||||
node_box = nodebox,
|
node_box = nodebox,
|
||||||
on_construct = reset_meta,
|
on_construct = reset_meta,
|
||||||
on_receive_fields = function(pos, formname, fields)
|
on_receive_fields = function(pos, formname, fields)
|
||||||
|
if fields.quit then
|
||||||
|
return
|
||||||
|
end
|
||||||
reset(pos)
|
reset(pos)
|
||||||
reset_meta(pos, fields.code)
|
reset_meta(pos, fields.code)
|
||||||
local err = lc_update(pos, {type="program"})
|
local err = lc_update(pos, {type="program"})
|
||||||
@ -531,6 +534,9 @@ minetest.register_node(BASENAME .. "_burnt", {
|
|||||||
node_box = nodebox,
|
node_box = nodebox,
|
||||||
on_construct = reset_meta,
|
on_construct = reset_meta,
|
||||||
on_receive_fields = function(pos, formname, fields)
|
on_receive_fields = function(pos, formname, fields)
|
||||||
|
if fields.quit then
|
||||||
|
return
|
||||||
|
end
|
||||||
reset(pos)
|
reset(pos)
|
||||||
reset_meta(pos, fields.code)
|
reset_meta(pos, fields.code)
|
||||||
local err = lc_update(pos, {type="program"})
|
local err = lc_update(pos, {type="program"})
|
||||||
|
@ -98,6 +98,9 @@ minetest.register_node(nodename, {
|
|||||||
meta:set_string("eeprom", r)
|
meta:set_string("eeprom", r)
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formanme, fields, sender)
|
on_receive_fields = function(pos, formanme, fields, sender)
|
||||||
|
if fields.quit then
|
||||||
|
return
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if fields.band then
|
if fields.band then
|
||||||
fields.code = "sbi(C, A&B) :A and B are inputs, C is output"
|
fields.code = "sbi(C, A&B) :A and B are inputs, C is output"
|
||||||
|
Loading…
Reference in New Issue
Block a user