forked from Mirrorlandia_minetest/digilines
Update deprecated api calls
This commit is contained in:
parent
78d67f00a6
commit
b2f959328c
@ -14,7 +14,7 @@ function digiline:importrules(spec, node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function digiline:getAnyInputRules(pos)
|
function digiline:getAnyInputRules(pos)
|
||||||
local node = minetest.env:get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
spec = digiline:getspec(node)
|
spec = digiline:getspec(node)
|
||||||
if not spec then return end
|
if not spec then return end
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ function digiline:getAnyInputRules(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function digiline:getAnyOutputRules(pos)
|
function digiline:getAnyOutputRules(pos)
|
||||||
local node = minetest.env:get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
spec = digiline:getspec(node)
|
spec = digiline:getspec(node)
|
||||||
if not spec then return end
|
if not spec then return end
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ function digiline:transmit(pos, channel, msg, checked)
|
|||||||
if checked[checkedid] then return checked end
|
if checked[checkedid] then return checked end
|
||||||
checked[checkedid] = true
|
checked[checkedid] = true
|
||||||
|
|
||||||
local node = minetest.env:get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local spec = digiline:getspec(node)
|
local spec = digiline:getspec(node)
|
||||||
if not spec then return end
|
if not spec then return end
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ function digiline:update_autoconnect(pos, secondcall)
|
|||||||
digiline:update_autoconnect(zmympos, true)
|
digiline:update_autoconnect(zmympos, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
local digilinespec = minetest.registered_nodes[minetest.env:get_node(pos).name].digiline
|
local digilinespec = minetest.registered_nodes[minetest.get_node(pos).name].digiline
|
||||||
if not digilinespec then return nil end
|
if not digilinespec then return nil end
|
||||||
if not digilinespec.wire then return nil end
|
if not digilinespec.wire then return nil end
|
||||||
|
|
||||||
@ -80,5 +80,5 @@ function digiline:update_autoconnect(pos, secondcall)
|
|||||||
tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy)
|
tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy)
|
||||||
|
|
||||||
|
|
||||||
minetest.env:set_node(pos, {name = digilinespec.wire.basename..nodeid})
|
minetest.set_node(pos, {name = digilinespec.wire.basename..nodeid})
|
||||||
end
|
end
|
||||||
|
@ -33,11 +33,11 @@ local lcds = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local reset_meta = function(pos)
|
local reset_meta = function(pos)
|
||||||
minetest.env:get_meta(pos):set_string("formspec", "field[channel;Channel;${channel}]")
|
minetest.get_meta(pos):set_string("formspec", "field[channel;Channel;${channel}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
local clearscreen = function(pos)
|
local clearscreen = function(pos)
|
||||||
local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
|
local objects = minetest.get_objects_inside_radius(pos, 0.5)
|
||||||
for _, o in ipairs(objects) do
|
for _, o in ipairs(objects) do
|
||||||
if o:get_entity_name() == "digilines_lcd:text" then
|
if o:get_entity_name() == "digilines_lcd:text" then
|
||||||
o:remove()
|
o:remove()
|
||||||
@ -46,9 +46,9 @@ local clearscreen = function(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local prepare_writing = function (pos)
|
local prepare_writing = function (pos)
|
||||||
lcd_info = lcds[minetest.env:get_node(pos).param2]
|
lcd_info = lcds[minetest.get_node(pos).param2]
|
||||||
if lcd_info == nil then return end
|
if lcd_info == nil then return end
|
||||||
local text = minetest.env:add_entity(
|
local text = minetest.add_entity(
|
||||||
{x = pos.x + lcd_info.delta.x,
|
{x = pos.x + lcd_info.delta.x,
|
||||||
y = pos.y + lcd_info.delta.y,
|
y = pos.y + lcd_info.delta.y,
|
||||||
z = pos.z + lcd_info.delta.z}, "digilines_lcd:text")
|
z = pos.z + lcd_info.delta.z}, "digilines_lcd:text")
|
||||||
@ -58,7 +58,7 @@ local prepare_writing = function (pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local on_digiline_receive = function(pos, node, channel, msg)
|
local on_digiline_receive = function(pos, node, channel, msg)
|
||||||
local setchan = minetest.env:get_meta(pos):get_string("channel")
|
local setchan = minetest.get_meta(pos):get_string("channel")
|
||||||
if setchan ~= channel then return end
|
if setchan ~= channel then return end
|
||||||
|
|
||||||
clearscreen(pos)
|
clearscreen(pos)
|
||||||
@ -86,9 +86,9 @@ minetest.register_node("digilines_lcd:lcd", {
|
|||||||
groups = {choppy = 3, dig_immediate = 2},
|
groups = {choppy = 3, dig_immediate = 2},
|
||||||
|
|
||||||
after_place_node = function (pos, placer, itemstack)
|
after_place_node = function (pos, placer, itemstack)
|
||||||
local param2 = minetest.env:get_node(pos).param2
|
local param2 = minetest.get_node(pos).param2
|
||||||
if param2 == 0 or param2 == 1 then
|
if param2 == 0 or param2 == 1 then
|
||||||
minetest.env:add_node(pos, {name = "digilines_lcd:lcd", param2 = 3})
|
minetest.add_node(pos, {name = "digilines_lcd:lcd", param2 = 3})
|
||||||
end
|
end
|
||||||
prepare_writing (pos)
|
prepare_writing (pos)
|
||||||
end,
|
end,
|
||||||
@ -102,7 +102,7 @@ minetest.register_node("digilines_lcd:lcd", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
minetest.env:get_meta(pos):set_string("channel", fields.channel)
|
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
digiline =
|
digiline =
|
||||||
@ -122,7 +122,7 @@ minetest.register_entity("digilines_lcd:text", {
|
|||||||
textures = {},
|
textures = {},
|
||||||
|
|
||||||
on_activate = function(self)
|
on_activate = function(self)
|
||||||
local meta = minetest.env:get_meta(self.object:getpos())
|
local meta = minetest.get_meta(self.object:getpos())
|
||||||
local text = meta:get_string("text")
|
local text = meta:get_string("text")
|
||||||
self.object:set_properties({textures={generate_texture(create_lines(text))}})
|
self.object:set_properties({textures={generate_texture(create_lines(text))}})
|
||||||
end
|
end
|
||||||
|
@ -22,9 +22,9 @@ local lsensor_selbox =
|
|||||||
}
|
}
|
||||||
|
|
||||||
local on_digiline_receive = function (pos, node, channel, msg)
|
local on_digiline_receive = function (pos, node, channel, msg)
|
||||||
local setchan = minetest.env:get_meta(pos):get_string("channel")
|
local setchan = minetest.get_meta(pos):get_string("channel")
|
||||||
if channel == setchan and msg == GET_COMMAND then
|
if channel == setchan and msg == GET_COMMAND then
|
||||||
local lightval = minetest.env:get_node_light(pos)
|
local lightval = minetest.get_node_light(pos)
|
||||||
digiline:receptor_send(pos, digiline.rules.default, channel, lightval)
|
digiline:receptor_send(pos, digiline.rules.default, channel, lightval)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -46,11 +46,11 @@ minetest.register_node("digilines_lightsensor:lightsensor", {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
fields.channel = fields.channel or ""
|
fields.channel = fields.channel or ""
|
||||||
meta:set_string("channel", fields.channel)
|
meta:set_string("channel", fields.channel)
|
||||||
end,
|
end,
|
||||||
|
@ -17,9 +17,9 @@ local rtc_selbox =
|
|||||||
}
|
}
|
||||||
|
|
||||||
local on_digiline_receive = function (pos, node, channel, msg)
|
local on_digiline_receive = function (pos, node, channel, msg)
|
||||||
local setchan = minetest.env:get_meta(pos):get_string("channel")
|
local setchan = minetest.get_meta(pos):get_string("channel")
|
||||||
if channel == setchan and msg == GET_COMMAND then
|
if channel == setchan and msg == GET_COMMAND then
|
||||||
local timeofday = minetest.env:get_timeofday()
|
local timeofday = minetest.get_timeofday()
|
||||||
digiline:receptor_send(pos, digiline.rules.default, channel, timeofday)
|
digiline:receptor_send(pos, digiline.rules.default, channel, timeofday)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -42,11 +42,11 @@ minetest.register_node("digilines_rtc:rtc", {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
fields.channel = fields.channel or ""
|
fields.channel = fields.channel or ""
|
||||||
meta:set_string("channel", fields.channel)
|
meta:set_string("channel", fields.channel)
|
||||||
end,
|
end,
|
||||||
|
Loading…
Reference in New Issue
Block a user