diff --git a/mods/default/functions.lua b/mods/default/functions.lua index def607bf..f8a82679 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -293,12 +293,25 @@ minetest.register_abm({ -- Dig upwards -- -function default.dig_up(pos, node, digger) +local in_dig_up = false +function default.dig_up(pos, node, digger, max_height) + if in_dig_up then return end -- Avoid excess calls if digger == nil then return end - local np = {x = pos.x, y = pos.y + 1, z = pos.z} - local nn = minetest.get_node(np) - if nn.name == node.name then - minetest.node_dig(np, nn, digger) + max_height = max_height or tonumber(minetest.settings:get("mapgen_limit")) or 31007 + + for y = pos.y + 1, max_height do + local up_pos = { x = pos.x, y = y, z = pos.z} + local up_node = minetest.get_node(up_pos) + if up_node.name == node.name then + in_dig_up = true + if not minetest.dig_node(up_pos, digger) then + in_dig_up = false + break + end + in_dig_up = false + else + break + end end end diff --git a/mods/default/init.lua b/mods/default/init.lua index 878c5261..c603ebe8 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -17,7 +17,7 @@ default.get_translator = S -- and avoids obscure, hard to debug runtime errors. -- This section should be updated before release and older checks can be dropped -- when newer ones are introduced. -if ItemStack("").add_wear_by_uses == nil then +if not minetest.features.node_interaction_actor then error("\nThis version of Minetest Game is incompatible with your engine version ".. "(which is too old). You should download a version of Minetest Game that ".. "matches the installed engine version.\n")