diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..e1a8e73 --- /dev/null +++ b/init.lua @@ -0,0 +1,14 @@ +minetest.register_list_command("digcustom", "Configue custom autodig nodes", "digcustom_nodes") + +minetest.register_globalstep(function() + if minetest.settings:get_bool("digcustom") then + local list = (minetest.settings:get("digcustom_nodes") or ""):split(",") + local positions = minetest.find_nodes_near(minetest.localplayer:get_pos(), 5, list, true) + for i, pos in ipairs(positions) do + if i > 5 then break end + minetest.dig_node(pos) + end + end +end) + +minetest.register_cheat("DigCustom", "World", "digcustom") |