2019-03-19 00:40:17 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
|
|
|
Copyright (C) 2019 Joachim Stolberg
|
|
|
|
|
2020-10-19 20:09:17 +03:00
|
|
|
AGPL v3
|
2019-03-19 00:40:17 +03:00
|
|
|
See LICENSE.txt for more information
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-03-19 00:40:17 +03:00
|
|
|
]]--
|
|
|
|
|
|
|
|
function techage.ironage_swap_node(pos, name)
|
|
|
|
minetest.swap_node(pos, {name = name})
|
|
|
|
local node = minetest.registered_nodes[name]
|
|
|
|
if node.on_construct then
|
|
|
|
node.on_construct(pos)
|
|
|
|
end
|
|
|
|
if node.after_place_node then
|
|
|
|
node.after_place_node(pos)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function techage.ironage_swap_nodes(pos1, pos2, name1, name2)
|
|
|
|
for _,p in ipairs(minetest.find_nodes_in_area(pos1, pos2, name1)) do
|
|
|
|
techage.ironage_swap_node(p, name2)
|
|
|
|
end
|
|
|
|
end
|