forked from minetest-mods/technic
Actually call the mvps callback
This commit is contained in:
parent
83ecc59e5b
commit
902cd07218
|
@ -105,36 +105,26 @@ local function move_nodes_vect(poslist,vect,must_not_move,owner)
|
||||||
return
|
return
|
||||||
end]]
|
end]]
|
||||||
end
|
end
|
||||||
nodelist={}
|
local nodelist = {}
|
||||||
frameslist = {}
|
|
||||||
for _, pos in ipairs(poslist) do
|
for _, pos in ipairs(poslist) do
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local meta = minetest.get_meta(pos):to_table()
|
local meta = minetest.get_meta(pos):to_table()
|
||||||
nodelist[#(nodelist)+1]={pos=pos,node=node,meta=meta}
|
nodelist[#(nodelist)+1] = {oldpos = pos, pos = vector.add(pos, vect), node = node, meta = meta}
|
||||||
if frames_pos[pos_to_string(pos)] then
|
|
||||||
frameslist[#frameslist+1] = {pos=pos, name=frames_pos[pos_to_string(pos)]}
|
|
||||||
frames_pos[pos_to_string(pos)] = nil
|
|
||||||
end
|
end
|
||||||
end
|
local objects = {}
|
||||||
objects={}
|
|
||||||
for _, pos in ipairs(poslist) do
|
for _, pos in ipairs(poslist) do
|
||||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||||
|
local entity = object:get_luaentity()
|
||||||
|
if not entity or not mesecon:is_mvps_unmov(entity.name) then
|
||||||
add_table(objects, object)
|
add_table(objects, object)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
for _, obj in ipairs(objects) do
|
for _, obj in ipairs(objects) do
|
||||||
obj:setpos(vector.add(obj:getpos(), vect))
|
obj:setpos(vector.add(obj:getpos(), vect))
|
||||||
le=obj:get_luaentity()
|
|
||||||
if le and le.name == "pipeworks:tubed_item" then
|
|
||||||
le.start_pos=vector.add(le.start_pos,vect)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _, n in ipairs(frameslist) do
|
|
||||||
local npos=vector.add(n.pos,vect)
|
|
||||||
frames_pos[pos_to_string(npos)] = n.name
|
|
||||||
end
|
end
|
||||||
for _,n in ipairs(nodelist) do
|
for _,n in ipairs(nodelist) do
|
||||||
local npos=vector.add(n.pos,vect)
|
local npos = n.pos
|
||||||
minetest.set_node(npos, n.node)
|
minetest.set_node(npos, n.node)
|
||||||
local meta = minetest.get_meta(npos)
|
local meta = minetest.get_meta(npos)
|
||||||
meta:from_table(n.meta)
|
meta:from_table(n.meta)
|
||||||
|
@ -148,6 +138,9 @@ local function move_nodes_vect(poslist,vect,must_not_move,owner)
|
||||||
for __, pos in ipairs(poslist) do
|
for __, pos in ipairs(poslist) do
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
end
|
end
|
||||||
|
for _, callback in ipairs(mesecon.on_mvps_move) do
|
||||||
|
callback(nodelist)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_supported_node(name)
|
local function is_supported_node(name)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user