mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-07-06 17:40:24 +02:00
Cleanup, make and use util.lua, port command block and delayer to nodedef
This commit is contained in:
15
mesecons/util.lua
Normal file
15
mesecons/util.lua
Normal file
@ -0,0 +1,15 @@
|
||||
function mesecon:swap_node(pos, name)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local data = minetest.env:get_meta(pos):to_table()
|
||||
node.name = name
|
||||
minetest.env:add_node(pos, node)
|
||||
minetest.env:get_meta(pos):from_table(data)
|
||||
end
|
||||
|
||||
function mesecon:addPosRule(p, r)
|
||||
return {x = p.x + r.x, y = p.y + r.y, z = p.z + r.z}
|
||||
end
|
||||
|
||||
function mesecon:cmpPos(p1, p2)
|
||||
return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z)
|
||||
end
|
Reference in New Issue
Block a user