diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | init.lua | 14 | ||||
-rw-r--r-- | mod.conf | 3 | ||||
-rw-r--r-- | settingtypes.txt | 1 |
4 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,2 @@ +# digcustom +A dragonfire CSM to automatically dig custom nodes 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") diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..c60733a --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = digcustom +author = Fleckenstein +description = A dragonfire CSM to automatically dig custom nodes diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..3d266f2 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1 @@ +digcustom (DigCustom) bool false |