summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-28 14:27:01 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-28 14:27:01 -0700
commit823b386ed9d5ce1676fe070a4764981306301fd7 (patch)
treef584de3277a1c7ce9c5e1df0eb25cc7d4b3b9a30
parent4d14df956f005d8d4fd6d0fda830f09f942af034 (diff)
Protect digtron against catacomb creation
-rw-r--r--depends.txt3
-rw-r--r--init.lua32
2 files changed, 33 insertions, 2 deletions
diff --git a/depends.txt b/depends.txt
index 2af1e68..3806918 100644
--- a/depends.txt
+++ b/depends.txt
@@ -2,4 +2,5 @@ default
pipeworks?
doc?
hopper?
-awards? \ No newline at end of file
+awards?
+catacomb? \ No newline at end of file
diff --git a/init.lua b/init.lua
index c3c41c9..2d9e965 100644
--- a/init.lua
+++ b/init.lua
@@ -168,4 +168,34 @@ minetest.register_lbm({
"tooltip[period;Number of seconds to wait between each cycle]"
)
end
-}) \ No newline at end of file
+})
+
+if minetest.get_modpath("catacomb") and catacomb ~= nil and catacomb.chamber_protected_nodes ~= nil and catacomb.passage_protected_nodes ~= nil then
+ local digtron_nodes = {
+ minetest.get_content_id("digtron:inventory"),
+ minetest.get_content_id("digtron:fuelstore"),
+ minetest.get_content_id("digtron:combined_storage"),
+ minetest.get_content_id("digtron:axle"),
+ minetest.get_content_id("digtron:builder"),
+ minetest.get_content_id("digtron:controller"),
+ minetest.get_content_id("digtron:auto_controller"),
+ minetest.get_content_id("digtron:pusher"),
+ minetest.get_content_id("digtron:loaded_crate"),
+ minetest.get_content_id("digtron:digger"),
+ minetest.get_content_id("digtron:intermittent_digger"),
+ minetest.get_content_id("digtron:soft_digger"),
+ minetest.get_content_id("digtron:intermittent_soft_digger"),
+ minetest.get_content_id("digtron:dual_digger"),
+ minetest.get_content_id("digtron:dual_soft_digger"),
+ minetest.get_content_id("digtron:structure"),
+ minetest.get_content_id("digtron:light"),
+ minetest.get_content_id("digtron:panel"),
+ minetest.get_content_id("digtron:edge_panel"),
+ minetest.get_content_id("digtron:corner_panel"),
+ }
+ for _, node_id in pairs(digtron_nodes) do
+ minetest.debug("protecting ", dump(node_id))
+ catacomb.chamber_protected_nodes[node_id] = true
+ catacomb.passage_protected_nodes[node_id] = true
+ end
+end \ No newline at end of file