summaryrefslogtreecommitdiff
path: root/mesecons_gates
diff options
context:
space:
mode:
authorUberi <azhang9@gmail.com>2013-11-30 22:13:00 -0500
committerUberi <azhang9@gmail.com>2013-11-30 22:13:00 -0500
commit16b4b79c51719849588c49d1d47d9bcbc05533e4 (patch)
tree0554bf1fb3c1b293af4396cff9aac172e83bb727 /mesecons_gates
parentb4654cedb77b435857649e01545bb9e507ff6dae (diff)
downloadmesecons-16b4b79c51719849588c49d1d47d9bcbc05533e4.tar
mesecons-16b4b79c51719849588c49d1d47d9bcbc05533e4.tar.gz
mesecons-16b4b79c51719849588c49d1d47d9bcbc05533e4.tar.bz2
mesecons-16b4b79c51719849588c49d1d47d9bcbc05533e4.tar.xz
mesecons-16b4b79c51719849588c49d1d47d9bcbc05533e4.zip
Update code to standards of Minetest 0.4.8.
Diffstat (limited to 'mesecons_gates')
-rw-r--r--mesecons_gates/init.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua
index de232f1..1a9ee83 100644
--- a/mesecons_gates/init.lua
+++ b/mesecons_gates/init.lua
@@ -27,7 +27,7 @@ function update_gate(pos)
gate = get_gate(pos)
L = rotate_ports(
yc_get_real_portstates(pos),
- minetest.env:get_node(pos).param2
+ minetest.get_node(pos).param2
)
if gate == "diode" then
set_gate(pos, L.a)
@@ -44,7 +44,7 @@ end
function set_gate(pos, on)
gate = get_gate(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
if on ~= gate_state(pos) then
yc_heat(meta)
--minetest.after(0.5, yc_cool, meta)
@@ -66,19 +66,19 @@ function set_gate(pos, on)
end
function get_gate(pos)
- return minetest.registered_nodes[minetest.env:get_node(pos).name].mesecons_gate
+ return minetest.registered_nodes[minetest.get_node(pos).name].mesecons_gate
end
function gate_state(pos)
- name = minetest.env:get_node(pos).name
+ name = minetest.get_node(pos).name
return string.find(name, "_on") ~= nil
end
function pop_gate(pos)
gate = get_gate(pos)
- minetest.env:remove_node(pos)
+ minetest.remove_node(pos)
minetest.after(0.2, yc_overheat_off, pos)
- minetest.env:add_item(pos, "mesecons_gates:"..gate.."_off")
+ minetest.add_item(pos, "mesecons_gates:"..gate.."_off")
end
function rotate_ports(L, param2)
@@ -151,7 +151,7 @@ for _, gate in ipairs(gates) do
node_box = node_box,
walkable = true,
on_construct = function(pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_int("heat", 0)
update_gate(pos)
end,