mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 00:49:34 +01:00
Check node_replaceable after dig_by_piston
Allows tallgrass, nether vines etc to drop
This commit is contained in:
parent
e5829f719d
commit
98cf3b7f7a
1 changed files with 32 additions and 33 deletions
|
@ -141,21 +141,19 @@ function mesecon.mvps_get_stack(pos, dir, maximum, piston_pos)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not node_replaceable(nn.name) then
|
|
||||||
if minetest.get_item_group(nn.name, "dig_by_piston") == 1 then
|
if minetest.get_item_group(nn.name, "dig_by_piston") == 1 then
|
||||||
-- if we want the node to drop, e.g. sugar cane, do not count towards push limit
|
-- if we want the node to drop, e.g. sugar cane, do not count towards push limit
|
||||||
table.insert(dig_nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}})
|
table.insert(dig_nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}})
|
||||||
else
|
else
|
||||||
|
if not node_replaceable(nn.name) then
|
||||||
table.insert(nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}})
|
table.insert(nodes, {node = nn, pos = {x=np.x, y=np.y, z=np.z}})
|
||||||
if #nodes > maximum then return nil, nil, false, true end
|
if #nodes > maximum then return nil, nil, false, true end
|
||||||
end
|
|
||||||
|
|
||||||
-- add connected nodes to frontiers, connected is a vector list
|
-- add connected nodes to frontiers, connected is a vector list
|
||||||
-- the vectors must be absolute positions
|
-- the vectors must be absolute positions
|
||||||
local connected = {}
|
local connected = {}
|
||||||
local has_loop
|
local has_loop
|
||||||
if minetest.registered_nodes[nn.name]
|
if minetest.registered_nodes[nn.name] and minetest.registered_nodes[nn.name].mvps_sticky then
|
||||||
and minetest.registered_nodes[nn.name].mvps_sticky then
|
|
||||||
connected, has_loop = minetest.registered_nodes[nn.name].mvps_sticky(np, nn, piston_pos)
|
connected, has_loop = minetest.registered_nodes[nn.name].mvps_sticky(np, nn, piston_pos)
|
||||||
if has_loop then
|
if has_loop then
|
||||||
return {}, {}, true, false
|
return {}, {}, true, false
|
||||||
|
@ -182,6 +180,7 @@ function mesecon.mvps_get_stack(pos, dir, maximum, piston_pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
table.remove(frontiers, 1)
|
table.remove(frontiers, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue