]> git.lizzy.rs Git - digcustom.git/commitdiff
Initial Commit
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 11 Dec 2020 16:27:51 +0000 (17:27 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 11 Dec 2020 16:27:51 +0000 (17:27 +0100)
README [new file with mode: 0644]
init.lua [new file with mode: 0644]
mod.conf [new file with mode: 0644]
settingtypes.txt [new file with mode: 0644]

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..13c25ed
--- /dev/null
+++ b/README
@@ -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 (file)
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 (file)
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 (file)
index 0000000..3d266f2
--- /dev/null
@@ -0,0 +1 @@
+digcustom (DigCustom) bool false