Allow moving blocks through unloaded areas
This commit is contained in:
parent
902fabd148
commit
446de79704
@ -644,6 +644,9 @@ local function move_node(pos, pos1_idx, start_pos, lpath, max_speed, height, mov
|
|||||||
self.handover = handover
|
self.handover = handover
|
||||||
self.yoffs = yoffs
|
self.yoffs = yoffs
|
||||||
move_entity(obj, pos2, dir)
|
move_entity(obj, pos2, dir)
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -655,6 +658,7 @@ local function move_nodes(pos, meta, nvm, lpath, max_speed, height, move2to1, ha
|
|||||||
for idx = 1, #nvm.lpos1 do
|
for idx = 1, #nvm.lpos1 do
|
||||||
local pos1 = nvm.lpos1[idx]
|
local pos1 = nvm.lpos1[idx]
|
||||||
local pos2 = nvm.lpos2[idx]
|
local pos2 = nvm.lpos2[idx]
|
||||||
|
--print("move_nodes", idx, P2S(pos1), P2S(pos2))
|
||||||
|
|
||||||
if move2to1 then
|
if move2to1 then
|
||||||
pos1, pos2 = pos2, pos1
|
pos1, pos2 = pos2, pos1
|
||||||
@ -662,7 +666,10 @@ local function move_nodes(pos, meta, nvm, lpath, max_speed, height, move2to1, ha
|
|||||||
|
|
||||||
if not minetest.is_protected(pos1, owner) and not minetest.is_protected(pos2, owner) then
|
if not minetest.is_protected(pos1, owner) and not minetest.is_protected(pos2, owner) then
|
||||||
if is_simple_node(pos1) and is_valid_dest(pos2) then
|
if is_simple_node(pos1) and is_valid_dest(pos2) then
|
||||||
move_node(pos, idx, pos1, lpath, max_speed, height, move2to1, handover)
|
if move_node(pos, idx, pos1, lpath, max_speed, height, move2to1, handover) == false then
|
||||||
|
meta:set_string("status", S("No valid node at the start position"))
|
||||||
|
return false
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if not is_simple_node(pos1) then
|
if not is_simple_node(pos1) then
|
||||||
meta:set_string("status", S("No valid node at the start position"))
|
meta:set_string("status", S("No valid node at the start position"))
|
||||||
|
@ -140,9 +140,9 @@ local function exchange_node(pos, item, param2)
|
|||||||
local node = minetest.get_node_or_nil(pos)
|
local node = minetest.get_node_or_nil(pos)
|
||||||
if node and is_simple_node(node.name) then
|
if node and is_simple_node(node.name) then
|
||||||
if item and item:get_name() ~= "" and minetest.registered_nodes[item:get_name()] then
|
if item and item:get_name() ~= "" and minetest.registered_nodes[item:get_name()] then
|
||||||
flylib.exchange_node(pos, item:get_name(), param2)
|
fly.exchange_node(pos, item:get_name(), param2)
|
||||||
else
|
else
|
||||||
flylib.remove_node(pos)
|
fly.remove_node(pos)
|
||||||
end
|
end
|
||||||
if not techage.is_air_like(node.name) then
|
if not techage.is_air_like(node.name) then
|
||||||
return ItemStack(node.name), node.param2
|
return ItemStack(node.name), node.param2
|
||||||
|
Loading…
Reference in New Issue
Block a user